Skip to content

feat: support "help" as a subcommand synonymous with "--help" #868#878

Open
dhruveshmishra wants to merge 1 commit intolinode:devfrom
dhruveshmishra:support
Open

feat: support "help" as a subcommand synonymous with "--help" #868#878
dhruveshmishra wants to merge 1 commit intolinode:devfrom
dhruveshmishra:support

Conversation

@dhruveshmishra
Copy link
Copy Markdown

Added support for using help as a subcommand in the CLI.

Closes #868

What this does
Now the following commands work:

linode-cli instance help
linode-cli help instance

Both behave the same as using --help.

Why
While using different CLIs, I often find myself typing help as a subcommand instead of --help. Many tools like git and aws support this pattern, so adding it here makes the CLI a bit more intuitive and user-friendly.

Implementation
This is handled by checking for help in the arguments early and mapping it to --help. The change is minimal and doesn’t affect existing functionality.

Notes
If there’s a preferred way to handle this at the parser level instead of rewriting argv, I’m happy to update the implementation.

@dhruveshmishra dhruveshmishra requested review from a team as code owners April 4, 2026 06:40
@dhruveshmishra dhruveshmishra requested review from mawilk90 and mgwoj and removed request for a team April 4, 2026 06:40
@mgwoj mgwoj requested a review from Copilot April 7, 2026 09:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for using help as a CLI subcommand (e.g., linode-cli instance help, linode-cli help instance) by translating help into --help early in argument handling.

Changes:

  • Rewrites sys.argv when help is detected at the beginning or end of the argument list.
  • Adds a subprocess-based pytest to validate instance help behavior.
  • Introduces a package-lock.json file.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.

File Description
linodecli/cli.py Adds early argument rewriting to map help to --help.
tests/test_help_alias.py Adds an end-to-end style test that invokes the module and checks help output.
package-lock.json Adds a Node lockfile (currently empty).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread linodecli/cli.py
Comment thread linodecli/cli.py
Comment thread tests/test_help_alias.py
Comment thread tests/test_help_alias.py
Copy link
Copy Markdown
Contributor

@mgwoj mgwoj left a comment

Choose a reason for hiding this comment

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

Please follow the CoPilot suggestions

@dhruveshmishra
Copy link
Copy Markdown
Author

@mgwoj there are a little bit changes from co- pilot which ai gives unnessesary for the expansion of code the solution i had done covered the main portion which fix the issue so please consider it as a corrected code

@mawilk90 mawilk90 added the community-contribution for contributions made by a non-DX author label May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution for contributions made by a non-DX author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: support "help" as a subcommand synonymous with "--help"

4 participants