Comments (11)
As of now, I'm on it. I'll need to figure out more than a few things but once we're there we should be able to register commands in the form of a tree.
from taskcluster-cli.
Okay, I've spent a good deal of time thinking and reading up on other issues and it seems the best solution would be to design a custom parser for our needs.
Here is the idea I came up with. Assume the following command/subcommand structure:
taskcluster
| |
help +---slugid------+
/ | | \
v4 encode decode nice
The new parser would make it easy to create a CommandProvider
for each command and each of its subcommands.
To register taskcluster slugid
, I would do extpoints.Get("taskcluster").Get("slugid").Register(slugid{})
. To register subcommand encode
under slugid
, I would do extpoints.Get("taskcluster").Get("slugid").Get("encode").Register(encode{})
.
It would be possible to register a CommandProvider
at each node/leaf of the tree (including the root taskcluster
itself), and also to add code to be executed everytime a command under slugid
is called.
Obviously, there would also be options to add flags and options to each command and sub*command.
This would resolve:
- The present issue
- Issue #68, and give us metadata about options and subcommands
- Issue #64 (somewhat), and help tab completion
from taskcluster-cli.
Currently trying out github.com/alecthomas/kingpin as @t0xicCode suggested to see if it would work for us.
from taskcluster-cli.
Going custom. Built a command-definition system yesterday, and soon we'll have a parser/framework to go with that. See it in branch subcommands.
from taskcluster-cli.
Today's update:
Added/fixed/changed a few things, and moved the code to a new package named commander
. This way we might be able to export this under a new project at some point.
I'll try to do the parser in the next few days and have something working for our meeting on Friday.
from taskcluster-cli.
https://github.com/spf13/cobra?
from taskcluster-cli.
Didn't see this one while looking for possible packages to use... some features look similar, interestingly. I didn't look into it too much, however at this point I've got pretty much everything down, including the parser.
from taskcluster-cli.
While I don't want you to lose all the work you did, would it make sense to still try the library? If we can use an external library that we don't have to maintain and support, that'd leave more time for use to work on the specific features of the tool.
And cobra has bash completion "for free" as well 😄
from taskcluster-cli.
My notes from the meeting on Friday indicate we decided:
- spend a week working to use Cobra
- we may be able to move to the new system subcommand-by-subcommand. @yannlandry will work on a transition plan
from taskcluster-cli.
Pull request for step 1 online.
See the transition plan for more details.
from taskcluster-cli.
Closed by #99.
from taskcluster-cli.
Related Issues (20)
- Golinter warnings on status.go HOT 2
- u.Hostname undefined HOT 3
- APIs accepting continuation tokens don't work HOT 1
- Put releases in the index by their version, too HOT 1
- `taskcluster signin` fails to open browser on OS X HOT 14
- Taskcluster signin doesn't have a "Grant Credentials" section on Windows HOT 8
- Update meta-linter config HOT 3
- Fix taskcluster shell in git-bash on windows
- fix output from browser in `taskcluster signin` HOT 1
- Using taskcluster-cli cleanly within multiple shells HOT 2
- taskcluster signin not working on Windows HOT 4
- Creation of new client during taskcluster signin hangs after clicking "Create client" with "Connecting to localhost...", at least in Ubuntu VM HOT 3
- `taskcluster signin` server hangs before sending response HOT 1
- add a confirmation option to eliminate taskid and taskgroupid typos HOT 14
- Fail if TASKCLUSTER_ACCESS_TOKEN is set, but TASKCLUSTER_CLIENT_ID is empty HOT 3
- Running make updates vendor.json HOT 4
- All commands should accept TASKCLUSTER_ROOT_URL HOT 2
- Error messages should print on stderr, not stdout HOT 2
- taskcluster-cli should be installable through go get HOT 3
- CODE_OF_CONDUCT.md isn't correct HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from taskcluster-cli.