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

Use commander and chalk for command line tools #5

Closed
nichtich opened this issue Aug 5, 2016 · 5 comments
Closed

Use commander and chalk for command line tools #5

nichtich opened this issue Aug 5, 2016 · 5 comments

Comments

@nichtich
Copy link
Contributor

nichtich commented Aug 5, 2016

I use the node packages commander and chalk for wikidata-taxonomy. Asked by a German Wikipedia to create a command line tool to get coordinates of a Wikidata item, I created another script using these packages and I would like to make it part of wikidata-cli:

https://github.com/nichtich/wikidata-cli/tree/wdcoords

would you mind adding commander and chalk as dependencies? I think the other scripts can also benefit from them.

@maxlath
Copy link
Owner

maxlath commented Aug 26, 2016

(sorry for the delayed answer, I missed the notification somehow)

Yes! I was already considering commander indeed!
What about using it to restructure the whole wikidata-cli à la git with one root command (wd?), and subcommands?

chalk's needs is already covered by colors.js but I wouldn't mind trying it in this project :)

@nichtich
Copy link
Contributor Author

Yes, subcommands is a good idea but it may be easier to start moving one command after another. Maybe start with wdprops and wdsparql as they already start with wd ;-)

@maxlath
Copy link
Owner

maxlath commented Aug 26, 2016

I started working on commander integration in a dedicated branch, would love to have your feedback on that before publishing it as v2.0.0 :)

@nichtich
Copy link
Contributor Author

Looks great. I am not sure about lib/strings but don't no better way to repeat its content. We could implement global options such as --language and --clipboard by subclassing `commander and move some other functionality common to all commands to this subclass - but this is refactoring.

@maxlath
Copy link
Owner

maxlath commented Aug 28, 2016

Closing this issue: solved by 6f29435 (and following commits) for commander, and b4f6d8e for chalk.
Support for -l, --lang was added by d25724f, d34cfa3, and 4f5e805.
The discussion on --clipboard can continue in #4

@maxlath maxlath closed this as completed Aug 28, 2016
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

2 participants