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

Switch from docopt to click or argparse for sparse #115

Closed
dan-blanchard opened this issue Apr 7, 2015 · 7 comments
Closed

Switch from docopt to click or argparse for sparse #115

dan-blanchard opened this issue Apr 7, 2015 · 7 comments
Assignees
Milestone

Comments

@dan-blanchard
Copy link
Member

I know docopt is pretty popular at Parse.ly, but it doesn't offer great usability for something like sparse that has several subcommands.

For example, I would fully expect:

sparse run --help

to give me some run-specific, help, but it doesn't, and just prints out the whole giant usage string. The more commands we add, the worse this situation gets, as people just have to guess what the commands are for.

Click's click.command() decorator seems like a much nicer option for handling many commands,, although even just basic argparse is better suited to the task than docopt.

@dan-blanchard
Copy link
Member Author

Poke poke

@amontalenti
Copy link
Contributor

click came out in Apr 2014, which was a bit after I started working on streamparse's CLI. I am not opposed to switching to it. docopt was the best option back then, click may be the best one now -- and hopefully a new one isn't released in 2016 😒

@dan-blanchard
Copy link
Member Author

I am not opposed to switching to it.

I'll take that as permission to put together a PR. :trollface:

@amontalenti
Copy link
Contributor

Permission granted!

@dan-blanchard dan-blanchard self-assigned this Apr 9, 2015
@dan-blanchard dan-blanchard added this to the v2.0 milestone Apr 27, 2015
@hodgesds
Copy link
Contributor

hodgesds commented Jun 8, 2015

I've been hacking on a argparse branch a little bit. Still has a bit to go though.....
https://github.com/hodgesds/streamparse/tree/argparse-refactor

Tried to move each subcommand into a package in streamparse/bin. The sparse.py package has a hook to load the all the subparsers that it finds in that directory. That way subcommands can be managed in a rather independent way.

@dan-blanchard
Copy link
Member Author

@hodgesds I like that general approach. It would cut out an unnecessary external dependency for us.

@dan-blanchard
Copy link
Member Author

Closed by #152.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants