8000 feat(cli): refine '--help' handling in propose command by sasa-tomic · Pull Request #1363 · dfinity/dre · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(cli): refine '--help' handling in propose command #1363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

sasa-tomic
Copy link
Member
@sasa-tomic sasa-tomic commented Mar 12, 2025

Improvements

  • Help Handling: Implement manual '--help' handling in Propose struct, disabling automatic flag parsing to manage propose subcommands.
  • Dry-Run Mode: Enable dry-run mode when '--help' is present to bypass interactive prompts.

### Key Changes

- **Disable Automatic Help Flag Parsing:**
  - Added `#[clap(disable_help_flag = true)]` to `Propose` struct to manually handle `--help`.

- **Manual Help Handling:**
  - Updated the `execute` method in the `Propose` command to call `ctx.help_propose(None)` when `--help` is detected.

- **Modify Submission Parameters:**
  - Enabled dry-run mode if `--help` is present to bypass unnecessary interactive prompts.

- **Access Control Adjustment:**
  - Changed `dry_run` in `ConfirmationModeOptions` from private to `pub(crate)` to support manual help handling.

- **Documentation and Comments:**
  - Updated comments to explain the manual handling of the `--help` flag and its effect on submission parameters.
@sasa-tomic sasa-tomic self-assigned this Mar 12, 2025
@sasa-tomic sasa-tomic marked this pull request as ready for review March 12, 2025 09:39
@sasa-tomic sasa-tomic requested a review from a team as a code owner March 12, 2025 09:39
@sasa-tomic sasa-tomic merged commit 293c69a into main Mar 12, 2025
7 checks passed
@sasa-tomic sasa-tomic deleted the fix/help-flag-handling branch March 12, 2025 10:57
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.

2 participants
0