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

Usage help has wrong order of options and commands #303

Closed
AndreGleichner opened this issue Nov 4, 2019 · 2 comments
Closed

Usage help has wrong order of options and commands #303

AndreGleichner opened this issue Nov 4, 2019 · 2 comments
Assignees
Labels
bug good first issue This seems like a good issue if you're a new contributor. help wanted We would be willing to take a well-written PR to help fix this.
Milestone

Comments

@AndreGleichner
Copy link
Contributor

Describe the bug
Generated usage help is e.g.
Usage: mytool [options] [command]
instead of:
Usage: mytool [command] [options]

To Reproduce
Steps to reproduce the behavior:

  1. Using this version of the library '2.4.2'
  2. Run code below
  3. With these arguments '-h'
  4. See wrong output "Usage: mytool [options] [command]"

Expected behavior
It should show "Usage: mytool [command] [options]"
Since having any options in front of the command verb fails.

Additional context
Repro code:

    [Command("mytool")]
    [Subcommand(typeof(MysubCommand))]
    class Program
    {
        static int Main(string[] args) => CommandLineApplication.Execute<Program>(args);
    }
    [Command]
    class MysubCommand { }

As a workaround I currently have a specialized DefaultHelpTextGenerator with overridden GenerateUsage().

@natemcmaster natemcmaster added good first issue This seems like a good issue if you're a new contributor. help wanted We would be willing to take a well-written PR to help fix this. labels Nov 5, 2019
@natemcmaster
Copy link
Owner

Seems like an easy one to fix if you're interested in contributing a change.

@AndreGleichner
Copy link
Contributor Author

See #308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue This seems like a good issue if you're a new contributor. help wanted We would be willing to take a well-written PR to help fix this.
Projects
None yet
Development

No branches or pull requests

2 participants