feat(cli): doctor accepts positional account alongside --account
This commit is contained in:
@@ -58,6 +58,20 @@ func TestListUsageErrorIsJSON(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDoctorPositionalAccount(t *testing.T) {
|
||||
adminEnv(t)
|
||||
// No such account: doctor should reach account lookup and fail there (exit 1),
|
||||
// proving the positional was accepted (not rejected as an unexpected arg).
|
||||
code, _, errOut := run(t, "doctor", "ghost")
|
||||
if code == 2 {
|
||||
t.Fatalf("positional account must be accepted, got usage error: %q", errOut)
|
||||
}
|
||||
// Giving both positional and --account with different values is a usage error.
|
||||
if code, _, _ := run(t, "doctor", "ghost", "--account", "other"); code != 2 {
|
||||
t.Fatal("conflicting positional + --account must be a usage error")
|
||||
}
|
||||
}
|
||||
|
||||
func b64Key() string {
|
||||
// 32 zero bytes, base64.
|
||||
return "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
|
||||
|
||||
Reference in New Issue
Block a user