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

Add API for titling an option group #492

Merged
merged 8 commits into from Sep 26, 2022

Commits on Sep 17, 2022

  1. Add API for titling an option group

    This change lets you provide a title for option groups, which is used
    when generating the help screen. Titled option groups, when they exist,
    are placed between the ARGUMENTS and OPTIONS section of the help.
    Multiple option groups with the same title are coalesced into a single
    group.
    
    For example, this command declaration:
    
        struct Extras: ParsableArguments {
          @Flag(help: "Print extra output while processing.")
          var verbose: Bool = false
    
          @Flag(help: "Include details no one asked for.")
          var oversharing: Bool = false
        }
    
        @main
        struct Example: ParsableCommand {
          @OptionGroup(title: "Extras")
          var extras: Extras
    
          @argument var name: String?
          @option var title: String?
        }
    
    yields this help screen:
    
        USAGE: example [--verbose] [--oversharing] [<name>] [--title <title>]
    
        ARGUMENTS:
          <name>
    
        EXTRAS:
          --verbose               Print extra output while processing.
          --oversharing           Include details no one asked for.
    
        OPTIONS:
          --title <title>
          -h, --help              Show help information.
    natecook1000 committed Sep 17, 2022
    Copy the full SHA
    772a551 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    7312820 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2022

  1. Copy the full SHA
    fb5c3e9 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    a5f13f2 View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2022

  1. Copy the full SHA
    53911ea View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2022

  1. Copy the full SHA
    abec9d7 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    a2727fd View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2022

  1. Copy the full SHA
    47188c7 View commit details
    Browse the repository at this point in the history