Merge lp:~jtv/maas/maascli-cli-subcommand into lp:maas/trunk
| Status: | Rejected |
|---|---|
| Rejected by: | Jeroen T. Vermeulen on 2012-11-01 |
| Proposed branch: | lp:~jtv/maas/maascli-cli-subcommand |
| Merge into: | lp:maas/trunk |
| Diff against target: |
67 lines (+9/-6) 3 files modified
src/maascli/cli.py (+6/-4) src/maascli/tests/test_cli.py (+2/-1) src/maascli/tests/test_integration.py (+1/-1) |
| To merge this branch: | bzr merge lp:~jtv/maas/maascli-cli-subcommand |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gavin Panella (community) | 2012-10-08 | Needs Information on 2012-10-08 | |
|
Review via email:
|
|||
Commit Message
Move maascli's CLI management commands (login, list etc.) into a dedicated sub-command "cli."
Description of the Change
This was pre-imped ages ago, I think several times actually. It seems like a complication to say "maascli cli list" instead of just "maascli list," and so on, but after this I'll be able to make maascli pick a default profile, and move the current profile's API operations directly into the main namespace. So in return for this extra work, you'll be able to type API verbs directly after the "maascli" command.
Jeroen
- 1226. By Jeroen T. Vermeulen on 2012-10-08
-
Fix some arbitrary typos to trigger a re-diff on the MP.
| Raphaël Badin (rvb) wrote : | # |
I agree with Gavin that putting login/logout/etc. under the 'cli' sub command will be a bit weird from a user's perspective.
I'm trying to think, step by step, what a user would do when he first interacts with the CLI and make sure that, at each step, what to do next is clear. As Gavin pointed out, the first step won't be obvious if the commands are "hidden" inside the 'cpi' subcommand. How about renaming login/logout/
What do you say?
| Jeroen T. Vermeulen (jtv) wrote : | # |
I would think that the right thing to do is point out the need for a login in the help text. I've already got some of that further up in my branch pipeline.
Once you're logged in, if there's a default profile, its API commands appear directly in the --help output.
| Jeroen T. Vermeulen (jtv) wrote : | # |
Scuttling this. We may or may not come back to it later, but for now we found the CLI tolerable with the improvements already made. Also, the “default profile” approach that this branch works towards is still controversial.
Unmerged revisions
- 1226. By Jeroen T. Vermeulen on 2012-10-08
-
Fix some arbitrary typos to trigger a re-diff on the MP.
- 1225. By Jeroen T. Vermeulen on 2012-10-08
-
Move cli commands out of maascli's main namespace.


> This was pre-imped ages ago, I think several times actually. It
> seems like a complication to say "maascli cli list" instead of just
> "maascli list," and so on, but after this I'll be able to make
> maascli pick a default profile, and move the current profile's API
> operations directly into the main namespace. So in return for this
> extra work, you'll be able to type API verbs directly after the
> "maascli" command.
I've made my thoughts clear ad nauseam, that I think having a default
profile is a retrograde step, but the code looks just fine :)
I'm actually having second thoughts about this change though. A new
user is going to be faced with:
$ bin/maascli --help
usage: bin/maascli [-h] COMMAND ...
optional arguments:
-h, --help show this help message and exit
drill down:
COMMAND
cli CLI management commands
http:// maas.ubuntu. com/
It's not very obvious what to do now - just like it wasn't when we had
the "api" command - and that's at odds with the desire to make things
easier for the newbie, for which the default profile is intended (and
exceedingly lazy typists).
I'm not going to reject this, but I do think this is a step too far,
and needs a second opinion.