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

dotnet --help command #4301

Closed
TheRealPiotrP opened this issue Oct 7, 2015 · 6 comments
Closed

dotnet --help command #4301

TheRealPiotrP opened this issue Oct 7, 2015 · 6 comments
Assignees

Comments

@TheRealPiotrP
Copy link
Contributor

should support both --help and invalid input.

@ahsonkhan
Copy link
Member

Here are the common usage scenarios that I see:

  1. dotnet

  2. dotnet -h

  3. dotnet --help

  4. dotnet -h|--help command
    [1-4] Show the help/usage for dotnet driver.

  5. dotnet command -h|--help
    Try to run dotnet-command with -h (or --help) as argument, which presumable shows help for the specific command.

  6. dotnet invalidCommand
    Try to run dotnet-invalidCommand and if the return code is non-zero, infer that the command does not exist (or usage failed), and show the help for the dotnet driver. I do not see any other way for the driver to know what commands are valid without having the dotnet-commands command be built in.

@brthor
Copy link
Contributor

brthor commented Oct 13, 2015

To sidestep needing to implement help on every command we can call man "dotnet-commandname" in scenario 5. This is the way git handles this same scenario.

@TheRealPiotrP
Copy link
Contributor Author

This is great, @ahsonkhan !

@brthor , how does your proposal scale out to Windows?

@ahsonkhan, what is your implementation intention here? Will this be a small feature? I'd love to be able to get three implementations, one for each CLI lib listed in dotnet/cli#35 as well as https://github.com/docopt/docopt.net. We could then get your thoughts on which was easiest to work with and most linuxy. thoughts?

@brthor
Copy link
Contributor

brthor commented Oct 14, 2015

@piotrpMSFT For windows we will need a different strategy because we don't have manpages. Going with Git as an example again, they bring up an html page. This could work but we'd need to generate html in addition to nroff from the docs.json. There are tools like "man2html" which go from nroff to html, but they only seem to work on Linux.

Having done this research now, I think implementing --help in each command will be less work and potentially easier to maintain.

@ahsonkhan
Copy link
Member

@piotrpMSFT I am using the DNX parser. I can try and use the other parsers and see which one was the easiest to use. However, how do I measure ease of use?

@knarfalingus
Copy link

Just wanted to ping this since I just experienced it on Ubuntu, I typed dotnet restor -s https://myget.org/f/dotnet-core (note the missing e) and got a stack trace (Unhandled Exception: System.ComponentModel.Win32Exception: No such file or directory), I feel it would be more helpful to show a message like "invalid command 'restor'" or similar and then display the help text as if --help had been specified.

wli3 referenced this issue in wli3/cli Jul 14, 2017
Allow our Build.Tasks.dll to load successfully by packaging its dependent assemblies along side of it.
dotnet-maestro-bot referenced this issue in dotnet-maestro-bot/cli Aug 7, 2018
@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants