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

Recommendation for Command Line Parser #35

Closed
TheRealPiotrP opened this Issue Oct 8, 2015 · 15 comments

Comments

Projects
None yet
@TheRealPiotrP
Copy link
Contributor

TheRealPiotrP commented Oct 8, 2015

Can someone make a recommendation on what CLI parser to use? some options:

  • ASP.NET
  • CoreFx
  • docopt

@TheRealPiotrP TheRealPiotrP added this to the November-2015 milestone Oct 8, 2015

@Eilon

This comment has been minimized.

Copy link
Member

Eilon commented Oct 9, 2015

Do we need managed or unmanaged or both?

For managed code, DNX has one that is used in several utilities.

And it generates output like this:

C:\Users\elipton>dnu
Microsoft .NET Development Utility Clr-x86-1.0.0-rc1-15798

Usage: dnu [options] [command]

Options:
  -v|--verbose  Show verbose output
  -?|-h|--help  Show help information
  --version     Show version information

Commands:
  build             Produce assemblies for the project in given directory
  clear-http-cache  Clears the package cache.
  commands          Commands related to managing application commands (install, uninstall)
  feeds             Commands related to managing package feeds currently in use
  install           Install the given dependency
  list              Print the dependencies of a given project
  pack              Build NuGet packages for the project in given directory
  packages          Commands related to managing local and remote packages folders
  publish           Publish application for deployment
  restore           Restore packages
  wrap              Wrap a csproj/assembly into a project.json, which can be referenced by project.json files

Use "dnu [command] --help" for more information about a command.

And:

C:\Users\elipton>dnu build --help


Usage: dnu build [arguments] [options]

Arguments:
  [projects]  One or more projects build. If not specified, the project in the current directory will be used.

Options:
  --framework <TARGET_FRAMEWORK>   A list of target frameworks to build.
  --configuration <CONFIGURATION>  A list of configurations to build.
  --out <OUTPUT_DIR>               Output directory
  --quiet                          Do not show output such as dependencies in use
  -?|-h|--help                     Show help information
@ahsonkhan

This comment has been minimized.

Copy link
Member

ahsonkhan commented Oct 9, 2015

The above mentioned command line utility is what is currently being used.
Another alternative is the command line utility as part of corefx:
https://github.com/dotnet/corefxlab/tree/master/src/System.CommandLine

@KrzysztofCwalina

This comment has been minimized.

Copy link
Member

KrzysztofCwalina commented Oct 9, 2015

The corefxlab one does not use reflection, so [edit: might be] better for AOT

@Eilon

This comment has been minimized.

Copy link
Member

Eilon commented Oct 9, 2015

Hmm does the DNX one use reflection? I haven't dug into the code a whole lot but I didn't see any usage. Might have missed it.

@anurse

This comment has been minimized.

Copy link
Collaborator

anurse commented Oct 12, 2015

The DNX one doesn't use reflection either.

@bricelam

This comment has been minimized.

Copy link
Contributor

bricelam commented Nov 17, 2015

+1 for System.CommandLine; It's a lot like DNX's CommandLineUtils, but better in my opinion. 😈

@agocke

This comment has been minimized.

Copy link
Collaborator

agocke commented Nov 17, 2015

System.CommandLine is already being used in dotnet-compile* -- I think it's worked pretty well. I hit issues with DNX command line since it's currently source-only and it also ties execution semantics of the program to command line parsing (i.e., app.Execute(args)).

@anurse

This comment has been minimized.

Copy link
Collaborator

anurse commented Nov 17, 2015

@bricelam SCANDAL! TRAITOR! HEATHEN! Nah, sounds good to me :). Let's move to System.CommandLine

@TheRealPiotrP

This comment has been minimized.

Copy link
Contributor Author

TheRealPiotrP commented Nov 17, 2015

@krwq can you pick this up next?

@Petermarcu Petermarcu removed this from the November-2015 milestone Nov 23, 2015

@TheRealPiotrP TheRealPiotrP added this to the Beta-Jan milestone Dec 14, 2015

@anurse

This comment has been minimized.

Copy link
Collaborator

anurse commented Dec 15, 2015

It seems we've been transitioning to System.CommandLine. Should we just get everything switched over and remove the DNX parser?

@davidfowl

This comment has been minimized.

Copy link
Collaborator

davidfowl commented Dec 15, 2015

Yes and fix the bugs in system.commandline

@Eilon

This comment has been minimized.

Copy link
Member

Eilon commented Dec 15, 2015

@davidfowl anything specific?

@davidfowl

This comment has been minimized.

Copy link
Collaborator

davidfowl commented Dec 15, 2015

Might just be a bug in run right now but you can't flow arguments to the application. i.e.

dotnet run --blag won't work

@TheBlueSky

This comment has been minimized.

Copy link

TheBlueSky commented Dec 25, 2015

Now that dotnet is going to use System.CommandLine, is it safe to assume that System.CommandLine will make it to corefx repository?

@brthor brthor modified the milestones: RC2-Feb, Beta-Jan Jan 8, 2016

@blackdwarf

This comment has been minimized.

Copy link
Contributor

blackdwarf commented Feb 25, 2016

Guys, since we have started using the System.CommandLine, I will close this issue. Please reopen if needed.

/cc @piotrpMSFT

@blackdwarf blackdwarf closed this Feb 25, 2016

wli3 pushed a commit to wli3/cli that referenced this issue Jul 14, 2017

Merge pull request dotnet#35 from eerhardt/Publish
Initial implementation of the Publish target.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment