Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Nov 25, 2025

Summary

Fixes --help and --version CLI flags not working in the desktop app.

Root cause: The tauri-plugin-cli converts clap's DisplayHelp and DisplayVersion errors into Ok(Matches) with "help" and "version" keys in matches.args. The existing entrypoint function only checked for subcommands and ignored these special keys, so --help/--version would silently do nothing.

Fix: Added handling at the start of entrypoint() to check for these keys, print the appropriate output, and exit cleanly.

Verified on Linux

Release build tested successfully:

$ ./target/release/desktop --help
Hyprnote

Usage: desktop [COMMAND]

Commands:
  changelog  Open the changelog page
  bug        Open GitHub issues page to report a bug
  web        Open https://hyprnote.com
  help       Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help (see a summary with '-h')
  -V, --version  Print version
$ ./target/release/desktop --version
Hyprnote Dev 0.0.0

Review & Testing Checklist for Human

  • Verify the version output format ({name} {version}) is acceptable - could be changed to just {version} if preferred
  • Test that existing subcommands still work: hyprnote bug, hyprnote web, hyprnote changelog
  • Note: Cargo.lock shows an unrelated tauri-plugin-importer addition - verify this is expected or revert if not
  • Test on macOS if that's your primary platform (I tested on Linux)

Notes

  • The fix uses std::process::exit(0) which is standard for CLI help/version handling
  • There's an unused handle_cli_matches function in ext.rs that attempted similar logic but was never called - could be cleaned up in a follow-up

Link to Devin run: https://app.devin.ai/sessions/55712bc7389c4dc6b78c0dded19003c0
Requested by: yujonglee (@yujonglee)

The tauri-plugin-cli converts clap's DisplayHelp and DisplayVersion errors
into Ok(Matches) with 'help' and 'version' keys in matches.args. This change
adds handling for these cases in the entrypoint function to print the help
text or version and exit cleanly.

Co-Authored-By: yujonglee <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Nov 25, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit af38548
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/692642deb0ff9f0008ca37c2
😎 Deploy Preview https://deploy-preview-1897--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link

coderabbitai bot commented Nov 25, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1764114848-fix-cli-help-version

Comment @coderabbitai help to get the list of available commands and usage tips.

@netlify
Copy link

netlify bot commented Nov 25, 2025

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit af38548
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/692642de1a0e370008d5741c
😎 Deploy Preview https://deploy-preview-1897--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@yujonglee yujonglee merged commit e18e787 into main Nov 26, 2025
13 checks passed
@yujonglee yujonglee deleted the devin/1764114848-fix-cli-help-version branch November 26, 2025 00:20
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