Skip to content

Print help when required subcommands are omitted#34

Merged
t-kalinowski merged 7 commits into
mainfrom
print-help-on-missing-subcommand
Jun 9, 2026
Merged

Print help when required subcommands are omitted#34
t-kalinowski merged 7 commits into
mainfrom
print-help-on-missing-subcommand

Conversation

@t-kalinowski

@t-kalinowski t-kalinowski commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Make command switches required by default, so omitting a subcommand prints scoped help for the current command level.
  • Add #| required: false as the explicit opt-out for apps or nested commands that intentionally allow running without a command.
  • Update the bundled todo example, README guidance, and NEWS to describe the required-by-default command pattern.
  • Add regression coverage with snapshot tests that capture the app source, invocation, and output in YAML form, including the opt-out path.

Closes #21.

Internal changes

  • Record command-switch metadata from annotations during app parsing so runtime can tell whether a missing command should print help.
  • Call the existing help renderer from argument processing when a required command is omitted, without adding a new public API surface.
  • Update test fixtures that intentionally allow no command to opt out with #| required: false.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a6f4927b2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread R/args.R

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 84ace8d0b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread R/args.R Outdated
@t-kalinowski t-kalinowski merged commit d0472a3 into main Jun 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show help when subcommand is omitted; expose programmatic help API

1 participant