DanielKeep/cargo-script

Allow running the program as `cargo-script file.rs`

bluss opened this issue · 5 comments

bluss commented

Must run as cargo script file.rs currently. Is there a reason cargo-script file.rs could not work?

> touch script
> cargo-script script

Does that try to execute a file called script, or did I type cargo script and forget to provide a filename? (As an aside, I'm actually not even sure if clap can reconcile this case.) This is actually why I added the run-cargo-script trampoline, for shebang lines.

Is there any particularly compelling reason why you'd want to use cargo-script instead of cargo script?

bluss commented

Not really. if run-cargo-script exists, I can use that.

Reached for cargo-script first and I don't know why. But as it is right now, cargo script x<tab> does not complete on filenames, so that's not really viable either.

bluss commented

I'm using some kind of bash script for cargo completion since it knows how to complete cargo subcommands. Like cargo scr<tab> for example.

Well, I don't know anything about how completion works. Maybe the script is blocking completion of stuff it doesn't recognise?

bluss commented

We can close this.