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

consider multi-subcommand model #51

Open
salewski opened this issue Oct 5, 2020 · 0 comments
Open

consider multi-subcommand model #51

salewski opened this issue Oct 5, 2020 · 0 comments
Labels
status:acknowledged type:idea Ideas for enhancements or better ways of doing things

Comments

@salewski
Copy link
Owner

salewski commented Oct 5, 2020

Consider whether or not a multi-subcommand interface might be a better long term approach for the ads-github-tools.

While working on issue #48, I started going down the road of implementing an ads-github-repo dispatcher command with a create subcommand. The main motivation for doing so would be to make the code for the individual subcommands more manageable, while still presenting a uniform interface for the end-user (me) working in the "single github repo" domain. This might be useful at a higher level, too, though; maybe something like:

    $ agh foo

where "agh" is short for "ads-github", and the top-level program dispatches to "ads-github-foo". More generally, it would look like:

    $ agh [GLOBAL_OPT...] SUB_COMMAND [SUBCMD_OPT...] [SUBCMD_ARG...]

Similar to the way git works, we would locate ads-github-* program on $PATH, but would give preference to our internally implemented progs, which would be installed somewhere beneath our @libexec@/@PROG@/ directory. A command dispatching to a subcommand would set up the process environment with information relevant to command line options already parsed.

The "multi-" aspect (which I'm not yet convinced is a good idea) would allow (theoretically) arbitrary levels of subdomains to be defined. More than the implicit two layers may start to get unwieldy, though, even if it would make the implementation easier. This is akin to how the aws/aws-cli program is implemented, which makes it easy enough to understand individual capabilities without needing to understand the entire program.

The ads-github-repo program, if implemented this way, would be comprised of three parts:

  1. agh (top-level dispatcher)
  2. ads-github-repo subcommand (for "domain" of single-repo actions)
  3. create (ads-github-repo-create?) specific tool for creating a single repo on GitHub

Not really sure how that third part would be realized in code.

@salewski salewski added status:acknowledged type:idea Ideas for enhancements or better ways of doing things labels Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:acknowledged type:idea Ideas for enhancements or better ways of doing things
Projects
None yet
Development

No branches or pull requests

1 participant