Skip to content
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

Help output correctly decides when to show the version option #1664

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

FrankRay78
Copy link
Contributor

@FrankRay78 FrankRay78 commented Oct 9, 2024

This PR is part of a series of CLI bug fixes/enhancements intended to be released prior to Spectre.Console V1.0

They should be individually reviewed and merged (and then the open ones rebased) in the following order, given they have been successively branched from each other (Rationale: earlier changes, particularly to CommandExecutor, are relied upon later). Separate PRs should aid the reviewer.

  1. Add parsed unknown flag to remaining arguments for a branch with a default command #1660
  2. Correctly show application version; execution of command with version option #1663
  3. Help output correctly decides when to show the version option #1664 (this one)

fixes #1567, #1479

  • I have read the Contribution Guidelines
  • I have commented on the issue above and discussed the intended changes
  • A maintainer has signed off on the changes and the issue was assigned to me
  • All newly added code is adequately covered by tests
  • All existing tests are still running without errors
  • The documentation was modified to reflect the changes OR no documentation changes are required.

Changes

Version information applies to the entire CLI application.
Whether to show the "-v|--version" option in the help is determined as per:

- If an application version has been set, and
-- When at the root of the application, or
-- When at the root of the application with a default command, unless
--- The default command has a version option in its settings

Please upvote 👍 this pull request if you are interested in it.

@FrankRay78 FrankRay78 marked this pull request as draft October 9, 2024 10:53
@FrankRay78 FrankRay78 self-assigned this Oct 9, 2024
@FrankRay78 FrankRay78 added area-CLI Command-Line Interface bug Something isn't working labels Oct 9, 2024
@FrankRay78 FrankRay78 added this to the 0.50 milestone Oct 9, 2024
@FrankRay78 FrankRay78 linked an issue Oct 9, 2024 that may be closed by this pull request
@FrankRay78 FrankRay78 changed the title Help output shows / hides version option correctly (DRAFT) Help output decides when to show the version option correctly (DRAFT) Oct 9, 2024
@FrankRay78 FrankRay78 changed the title Help output decides when to show the version option correctly (DRAFT) Help output correctly decides when to show the version option (DRAFT) Oct 9, 2024
@FrankRay78 FrankRay78 force-pushed the Help-writer-displays-version-option-correctly branch from 9919872 to dae2041 Compare October 14, 2024 10:41
@FrankRay78 FrankRay78 marked this pull request as ready for review October 15, 2024 13:11
@FrankRay78 FrankRay78 changed the title Help output correctly decides when to show the version option (DRAFT) Help output correctly decides when to show the version option Oct 15, 2024
@FrankRay78 FrankRay78 requested a review from a team October 15, 2024 13:11
@FrankRay78
Copy link
Contributor Author

Fully implemented and ready for review

Important: Please see the comment at the top of the issue description ahead of merging.

@patriksvensson patriksvensson modified the milestones: 0.50, 0.51 Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CLI Command-Line Interface bug Something isn't working
Projects
Status: PR 📬
2 participants