Skip to content

Commit 360a67d

Browse files
committed
Fix init message
1 parent afe5d6d commit 360a67d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

api/config/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func (c *Config) setFromGcloud() error {
163163
}
164164

165165
if c.Project == "" && gcloudConfig.Configuration.Properties.Core.Project != "" {
166-
fmt.Fprintf(c.ErrStream, "gcloud active project is \"%s\"", gcloudConfig.Configuration.Properties.Core.Project)
166+
fmt.Fprintf(c.ErrStream, "gcloud active project is \"%s\"\n", gcloudConfig.Configuration.Properties.Core.Project)
167167
c.Project = gcloudConfig.Configuration.Properties.Core.Project
168168
}
169169

api/interfaces/cli.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ type CLI struct {
3636

3737
// Run invokes the CLI with the given arguments
3838
func (c *CLI) Run(args []string) int {
39+
fmt.Fprintf(c.OutStream, "btcli Version: %s(%s)\n", c.Version, c.Revision)
40+
fmt.Fprintf(c.OutStream, "Please use `exit` or `Ctrl-D` to exit this program.\n")
41+
3942
conf, err := c.loadConfig(args)
4043
if err != nil {
4144
fmt.Fprintf(c.ErrStream, "args parse error: %v\n", err)
@@ -45,10 +48,9 @@ func (c *CLI) Run(args []string) int {
4548
histories := []string{}
4649
f, err := loadHistoryFile(conf)
4750
if err != nil {
48-
// NOTE: Continue processing even if an error occurred at open a file
51+
// Continue processing even if an error occurred at open a file
4952
fmt.Fprintf(c.ErrStream, "failed to a history file open: %v\n", err)
5053
} else {
51-
// TODO: Read lines and set to histories
5254
s := bufio.NewScanner(f)
5355
for s.Scan() {
5456
histories = append(histories, s.Text())
@@ -61,9 +63,6 @@ func (c *CLI) Run(args []string) int {
6163
fmt.Fprintf(c.ErrStream, "failed to initialized prompt: %v\n", err)
6264
return ExitCodeError
6365
}
64-
65-
fmt.Fprintf(c.OutStream, "btcli Version: %s(%s)\n", c.Version, c.Revision)
66-
fmt.Fprintf(c.OutStream, "Please use `exit` or `Ctrl-D` to exit this program.\n")
6766
p.Run()
6867

6968
// TODO: This is dead code. Invoke os.Exit by the prompt.Run

0 commit comments

Comments
 (0)