DanielKeep / cargo-script

Cargo script subcommand
Other
729 stars 37 forks source link

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

Closed bluss closed 8 years ago

bluss commented 8 years ago

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

DanielKeep commented 8 years ago
> 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 8 years ago

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 8 years ago

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.

DanielKeep commented 8 years ago

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

bluss commented 8 years ago

We can close this.