Hey @deep wadi, when passing script files like dagger script.sh, by default the root command uses positional arguments to match subcommands. We can allow arbitrary args in order to pass that to dagger shell but if you mistype a subcommand it will return an error saying that the file doesn't exist:
> dagger qery
Error: open qery: no such file or directory
While current behavior is this:
> dagger qery
Error: unknown command "qery" for "dagger"
Did you mean this?
query
That subcommand validation comes pretty early, you basically have to disable it in order to get it to pass through to dagger shell.
The function that generates the suggestions (for a mistyped subcommand) isn't exported publicly by cobra but we can copy its 15 LOC if we want to check for the file or subcommand existence before deciding to redirect or not.
Do you have an opinion on this?