issue_tree
    Preparing search index...

    Function parseCommand

    • Parse an issue_tree command line into a typed Command.

      Help is detected first (via detectHelp) and always wins: a bare invocation, a help subcommand, or --help/-h anywhere on the line yields a HelpCommand without ever reaching the strict option parser — which matters because parseArgs would otherwise throw on the unknown --help option. Only when help is not requested does an empty or unknown subcommand throw.

      Parameters

      • argv: string[]

        arguments after the node/script entries (subcommand first)

      Returns Command

      the parsed, discriminated command

      Error on a missing or unknown subcommand, or a bad flag (help paths never throw)

      parseCommand(['render', '--format', 'svg']).subcommand  // => 'render'
      parseCommand([]).subcommand // => 'help'
      parseCommand(['render', '--help']).subcommand // => 'help'