Repository navigation
CLI: Bring back removed CLI commands to help transition - #6508
Conversation
This is only for next release to help users transition. Should be removed at the latest on the official modules release. Signed-off-by: Helder Correia <[email protected]>
| SilenceUsage: true, | ||
| DisableFlagParsing: true, | ||
| Args: func(cmd *cobra.Command, args []string) error { | ||
| return fmt.Errorf(`%q has been replaced by "dagger call COMMANDS... --output=PATH"`, cmd.CommandPath()) |
There was a problem hiding this comment.
Would have expected to see export after COMMANDS... here - do we special-case this?
There was a problem hiding this comment.
Yeah, we could. I didn't because the point of --output is to provide more symmetry in the boundary between host and dagger. We had input flags, but no equivalent output concept. @sipsma wrote about this in -o flag for writing to caller's filesystem
- E.g. you can specify an input
Directoryarg as--dir ./some/input/dirbut to write aDirectoryto the caller's filesystem you have to go through the whole... export --path ./some/output/dir- This is okay generally speaking, but does create some asymmetry
Coming out of that, @shykes brought up idea of supporting a generic
-o <path>(--output <path>in long form) flag on the CLI command. This flag would be applicable for any return type and result in that result being written to the caller's filesystem rather than written to stdout.
As you can see dagger call build -o bin/ is shorter than dagger call build export --path=bin/, and it also works with most other types:
# dagger call test stdout -o test.$(date +%s).logHowever, since these "ghost" commands are just to make transition easier for next release, where many commands will fail to run, I'm not against making this consistent with the others and also choosing core chaining to export explicitly. 👍
There was a problem hiding this comment.
I'm good with the shorthand given how common it'll probably be, just didn't know about it. 👍 IMO we should point to it as long as that's what we expect folks to do instead of the explicit export.
This is only for next release to help users transition. Should be removed at the latest on the official modules release.
When using one of the removed commands:
User is presented with an error message referencing the new one, under dagger call.