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

feat(mangen): Support flatten_help #5769

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Commits on Oct 23, 2024

  1. test(mangen): Add test for flatten_help

    This test shows that the output stays the same independent of the value
    of `flatten_help`. Further commits may implement `flatten_help` for
    `clap_mangen`.
    
    Signed-off-by: Paul Spooren <[email protected]>
    aparcar committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    7685641 View commit details
    Browse the repository at this point in the history
  2. chore(mangen): Split out usage() function

    The function prints the usage of a (sub)command.
    
    Signed-off-by: Paul Spooren <[email protected]>
    aparcar committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    cec57c8 View commit details
    Browse the repository at this point in the history
  3. feat(mangen): Support flatten_help

    The `flatten_help` argument combines all subcommands on a single page.
    Until now this wasn't supported for `mangen`. With this command the
    sections `SYNOPSIS` as well as `SUBCOMMANDS` are changed to imitate the
    style of `git stash --help`.
    
    Differences between flattened `--help` and the flattened man:
    * `--help` prints the description at the very beginning while Man uses a
      section called DESCRIPTION below the USAGE.
    * `--help` prints placeholder `[OPTIONS]` while Man prints all options
    * `--help` prints positional options (aka arguments) in its own section
      called arguments while Man prints them at the end of OPTIONS.
    * `--help` prints subcommands as their own section after the options
      section while Man uses an extra section called SUBCOMMANDS
    * `--help` prints `after_long_help` at the very end while Man uses the
      section EXTRA which comes before the sections VERSION and AUTHORS
    
    Signed-off-by: Paul Spooren <[email protected]>
    aparcar committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    e19c5b5 View commit details
    Browse the repository at this point in the history
  4. test(mangen): Add all flatten related tests from builder

    Add all tests from tests/builder/help.rs to mangen, too.
    
    Signed-off-by: Paul Spooren <[email protected]>
    aparcar committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    004e815 View commit details
    Browse the repository at this point in the history