Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion e2e/errors.bats
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ load test_helper

run basecamp recordings
assert_failure
assert_output_contains "type required"
assert_json_value '.error' '<type> required'
assert_json_value '.code' 'usage'
}


Expand Down
11 changes: 5 additions & 6 deletions internal/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,13 @@ func isBareRequiredFlagError(err error, cmd *cobra.Command) bool {
}

// isMachineConsumer returns true when the root command's flags indicate a
// non-interactive consumer: --agent, --json, or stdout piped to a non-TTY.
// non-interactive consumer: --agent, --json, --quiet, etc., or stdout piped to a non-TTY.
func isMachineConsumer(root *cobra.Command) bool {
pf := root.PersistentFlags()
if agent, _ := pf.GetBool("agent"); agent {
return true
}
if jsonFlag, _ := pf.GetBool("json"); jsonFlag {
return true
for _, flag := range []string{"agent", "json", "quiet", "ids-only", "count"} {
if v, _ := pf.GetBool(flag); v {
return true
}
}
fi, err := os.Stdout.Stat()
if err == nil && (fi.Mode()&os.ModeCharDevice) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/cards.go
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ func newCardsStepsCmd(project *string) *cobra.Command {
cardID = args[0]
}
if cardID == "" {
return missingArg(cmd, "card-id|url")
return missingArg(cmd, "<card-id|url>")
}

cardIDInt, err := strconv.ParseInt(cardID, 10, 64)
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/recordings.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Type is required: todos, messages, documents, comments, cards, uploads.`,
}

if effectiveType == "" {
return missingArg(cmd, "type")
return missingArg(cmd, "<type>")
}

return runRecordingsList(cmd, app, effectiveType, project, status, sortBy, direction, limit, page, all)
Expand Down
Loading