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

Migrate command line interface to parsing library #234

Open
ashander opened this issue May 4, 2015 · 2 comments · May be fixed by #237
Open

Migrate command line interface to parsing library #234

ashander opened this issue May 4, 2015 · 2 comments · May be fixed by #237
Milestone

Comments

@ashander
Copy link

ashander commented May 4, 2015

Currently the top-level parsing just uses sys.argv then dispatches to subcommands which each have their own parser constructed with argparse. Although argparse has great aspects, I believe it's a bit tough to build a subcommmand-driven parser with it (thus the current construction I guess).

There are some great-seeming, recently-developed tools capable of implementing a complex CLI like smt. One example is cliff, but click seems more well-supported and documented. (See repo example for a subcommand system.)

Moving to one of these would not only support completion, but could aid long term maintenance and extensibility. For example, at the cost of some UI rigidity, it will make the CLI a little more self-documenting (removing the need for maintaining bin/smt by using entry points and providing top-level options for the smt command). Additionally, click in particular is python 2/3 agnostic so could help ease that transition (though of course the CLI is a very small part of this issue).

(Above first raised in #224 migrated to this new issue)

@apdavison
Copy link
Contributor

I'm not at all a fan of the entry point approach to scripts. My experience is that when things break, the multiple levels of indirection make it very hard to figure out what's wrong. However, it seems that using entry points could give us Windows script support for free (cf #111).

@ashander
Copy link
Author

I don't have much experience either way. I can look into whether entry point approach is required to use click. Windows bonus seems to work in favor of it though. Will discuss more on the PR

@apdavison apdavison modified the milestone: future Jun 1, 2015
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

Successfully merging a pull request may close this issue.

2 participants