This commit is contained in:
2025-11-19 19:08:21 +01:00
parent 8e18f2ce76
commit b314a683c9
3 changed files with 14 additions and 3 deletions

View File

@@ -32,7 +32,8 @@ func (p *LoginCmd) SetFlags(f *flag.FlagSet) {
func (p *LoginCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
if f.NArg() != 1 {
fmt.Fprintf(os.Stderr, "error: this command take 1 argument")
fmt.Fprintln(os.Stderr, "error: this command take 1 argument")
return subcommands.ExitUsageError
}
@@ -46,12 +47,12 @@ func (p *LoginCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{})
cli := client.New(server, username, password)
if _, err := cli.Version(); err != nil {
fmt.Fprintf(os.Stderr, "error: failed to login: %s", err)
fmt.Fprintf(os.Stderr, "error: failed to login: %s\n", err)
return subcommands.ExitFailure
}
if err := credentials.Login(username, password, server); err != nil {
fmt.Fprintf(os.Stderr, "error: failed to save login: %s", err)
fmt.Fprintf(os.Stderr, "error: failed to save login: %s\n", err)
return subcommands.ExitFailure
}