maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
227 stars 24 forks source link

Use commander and chalk for command line tools #5

Closed nichtich closed 8 years ago

nichtich commented 8 years ago

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 commented 8 years ago

(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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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