Skip to content
Merged
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
5 changes: 4 additions & 1 deletion scripts/check-cli-surface.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,10 @@ fi

# Capture root persistent flags once — these are available on every subcommand
# but --help --agent only reports them on the root command itself.
ROOT_FLAGS=$("$BINARY" --help --agent 2>/dev/null | jq -c '[.flags // [] | .[] | {name, type}]')
# Use a child command's inherited_flags to get only persistent flags, excluding
# local-only root flags like --version that Cobra does not propagate.
_first_sub=$("$BINARY" --help --agent 2>/dev/null | jq -r '.subcommands[0].name')
Comment thread
robzolkos marked this conversation as resolved.
ROOT_FLAGS=$("$BINARY" "${_first_sub}" --help --agent 2>/dev/null | jq -c '[.inherited_flags // [] | .[] | {name, type}]')
Comment thread
robzolkos marked this conversation as resolved.

walk_commands() {
local cmd_path="$1"
Expand Down