-
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
CLI: simplify and clarify usage text #7277
base: main
Are you sure you want to change the base?
Conversation
@shykes, I rebased. Only not merging because waiting for reply to #7277 (comment). |
@helderco you may want to rebase this again. These are the most important change that this PR has not picked up yet: |
Thanks, sorry I had missed your rebase earlier. |
Signed-off-by: Solomon Hykes <solomon@dagger.io>
by appending it to the end of the command (for example, ´stdout´, ´entries´, or | ||
´contents´). | ||
`, | ||
Name: "call [options] [FUNCTION [FUNCTION...]]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[arguments]
and <function>
are appended to the usage line dynamically based on the existence of arguments or further functions, respectively. So this will produce the following:
dagger call [options] [FUNCTION [FUNCTION...]] [arguments] <function>
[options]
only show on call
(doesn't include global flags), so leaving as is creates this usage while you keep adding functions (assuming there's constructor arguments):
dagger call [options] [arguments] <function>
dagger call cli <function>
dagger call cli file [arguments] <function>
dagger call cli file name
Notice also that we conventionalized usage syntax here:
`, | ||
Name: "call [options] [FUNCTION [FUNCTION...]]", | ||
Short: "Call a function, or a pipeline of functions", | ||
Long: strings.ReplaceAll(`Call a function, or a pipeline of functions, and print the result`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The strings.ReplaceAll
here is no longer needed. It was a clever hack to allow markdown with ´--output´
for example.
@@ -55,6 +41,7 @@ dagger call lint stdout | |||
case Terminal: | |||
c.Select("websocketEndpoint") | |||
default: | |||
// FIXME: don't make this an error, it's confusing to users |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error has been replaced with:
Basically any chain that ends in an object that has itself functions, lists them under "Available Functions".
This was meant to be a quick win... Does it even make sense for me to update this, with other improvements in flight? |
I think so. Let’s see:
Since we'll want to conventionalize on The update on the As for the examples, they're hardly helpful as they are. It would be more helpful to have a stable URL to add to the end of |
No description provided.