Skip to content

CLI: Bring back removed CLI commands to help transition - #6508

Merged
gerhard merged 1 commit into
dagger:mainfrom
helderco:cli-deprecated
Jan 30, 2024
Merged

gerhard merged 1 commit into
dagger:mainfrom
helderco:cli-deprecated

Conversation

@helderco

Copy link
Copy Markdown
Contributor

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:

  • dagger download
  • dagger shell
  • dagger up

User is presented with an error message referencing the new one, under dagger call.

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]>
@helderco helderco added this to the v0.9.8 milestone Jan 26, 2024
@helderco
helderco requested review from jedevc and sipsma January 26, 2024 16:37
Comment thread cmd/dagger/call.go
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())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would have expected to see export after COMMANDS... here - do we special-case this?

@helderco helderco Jan 26, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Directory arg as --dir ./some/input/dir but to write a Directory to 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).log

However, 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. 👍

@vito vito Jan 26, 2024 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@helderco helderco mentioned this pull request Jan 29, 2024

@gerhard gerhard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 🚀

@gerhard
gerhard merged commit 0abb58d into dagger:main Jan 30, 2024
@helderco
helderco deleted the cli-deprecated branch January 30, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants