-
Notifications
You must be signed in to change notification settings - Fork 558
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
De-clutter dagger call --help
#6943
Comments
FYI @helderco I know this is on your radar already |
Darn, seems there's a few issues I haven't created yet 😅 Yeah, all that and there's more. |
Following: These are not just for
Note Moved the above list to the description. Footnotes
|
I could help on that one @helderco, wdyt ? Seems a not too hard issue with figurable context dumps (or I'm wrong ahahah) 🙏 (even subsets) |
You're not wrong 🙂 Yeah, if you have cycles go ahead! |
I've got the uppercase + newline done 🙏 (easy part) For this part though, I'm not sure about what you mean in "top level commands". Because, with my tests, I only see the global flags on those 2 positions at the moment: on the root command (dagger help) and on any available subcommand (dagger functions --help), am I missing some other subcommands where this would be present ? Also, on the root, we name "Global flags" as "Flags", whereas in the rest of the other commands it's "global flags"
|
@grouville and I synced and I suggested to leave the global flags thing for later. Re: terminology, global flags are "persistent flags" from a parent command. In the command that sets them, they're just "Flags". But if they're persisted to their children, then from the children they're "global". I consider a "top-level" command, any command that is an immediate child of the root command ( I just think that showing global flags on children of top level commands just add clutter. I prefer adding these flags right after the root command. Otherwise, at minimum they should just be hidden. But if we actually remove them from top-level children (avoids clashing with user arguments in dagger call as well), it may require changing how flags are parsed, and it's in that scenario that it "may" be needed to use TraverseChildren. This is all very fleeting thought like, so that's why I suggest leaving it for later. The main intent is to limit where they're shown, to de-clutter as much as possible. |
Part of the de-clutter CLI implementation: dagger#6943 (comment). Takes inspiration from the `gh` CLI to visually break the heading sections. It relies on a helper function directly used on the template Signed-off-by: grouville <guillaume@dagger.io>
…#7126) Part of the de-clutter CLI implementation: #6943 (comment). Takes inspiration from the `gh` CLI to visually break the heading sections. It relies on a helper function directly used on the template Signed-off-by: grouville <guillaume@dagger.io>
Whilst working on #7143, I had the opportunity to stress test the CLI a bit. Brain dump:
|
As long as Basically:
It's intentional because we needed to get the "views" feature in Don't worry about it for now, just keep what's hidden hidden.
It's possible there's incorrent usage lines like that. If you find any, just fix the usage and validation if needed, to match the correct behavior. In this case yes: if it looks like it's required, then better make it required. There's a way to tell Cobra that this command is required to take 1 positional argument, for example. There's examples of this in
To be technically accurate, there's a difference between a command and a positional argument. In this case it's the latter.
Some CLIs just print an error, others print an error with usage included. Cobra does the latter in some cases but we may have needed to disable, especially when manually handling output like we do with the TUI. The best thing though is to help the user out, so I'd print the error with a short usage. You can see in Cobra there's a distinction between showing the usage and showing the full help. The help includes the usage, but you can show an error with the usage, without the full help. I've already established that 1. needs fixing, but check what's the default for Cobra, is it 2. or 3? Is there any special handling on our side in either of those cases? I tend to prefer having less on our side to maintain. But after having this answered and it feels better to do more, than let's talk when we cross that bridge 🙂
Yeah, that's not mandatory. I don't think it's actually used at all. Probably copy pasta 🙂 |
…dagger#7126) Part of the de-clutter CLI implementation: dagger#6943 (comment). Takes inspiration from the `gh` CLI to visually break the heading sections. It relies on a helper function directly used on the template Signed-off-by: grouville <guillaume@dagger.io>
dagger call --help
#7286
I'm closing this epic. If there's more things, we'll address via individual issues. |
Problem
dagger call [ARGS] --help
plays a crucial role, and must be kept as lean as possible. At the moment there is clutter that could be removed.Solution
De-clutter the output of
dagger call [ARGS] --help
.dagger call --help
#7286Additional
Improvements to make
--help
easier to read:--help
#7287Improve consistency:
flags
tooptions
#7170<command>
in cmd.Use #7143dagger query
has a different help templatedagger functions <function> --help
doesn't workdagger functions
#7187The text was updated successfully, but these errors were encountered: