Skip to content

Unable to include program name in generated Usage statementΒ #233

@willnationsdev

Description

@willnationsdev

As far as I can tell, there is no way for me to inject a placeholder for the actual program name into the Usage instructions used by all of the commands.

If I have subcommands added, then the default help text produces a Usage line that looks something like this:

Usage: [command] [-h|--help] [--version]

If I run git -h on my terminal, the usage line actually includes the git command itself (and the subcommands likewise prefix themselves with the actual program name). I don't seem to be able to reproduce that kind of behavior.

usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--no-lazy-fetch]
           [--no-optional-locks] [--no-advice] [--bare] [--git-dir=<path>]
           [--work-tree=<path>] [--namespace=<name>] [--config-env=<name>=<envvar>]
           <command> [<args>]

Perhaps there could be an assembly attribute folks could use to specify this? It should already be accessible from MSBuild's project properties though if people are using AssemblyName or ToolCommandName to specify the name of the executable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions