Skip to content

First CLI Argument should contain name of script instead of compiled binary #113

Closed
@ChristianS99

Description

@ChristianS99
#!/usr/bin/env rust-script
use std::env;

fn main() {
  let args: Vec<String> = env::args().collect();
  println!("{:?}", args);
}

executing this with rust-script prints out
["/home/chriss/.cache/rust-script/binaries/release/rust-script-test_83ff7425da238fd28ad88049"]
instead, I would expect "./rust-script-test.rs", or whatever the script is called with.

Would this be even possible?

Maybe related:
ps a
also shows script like
879316 pts/5 S+ 0:00 /home/chriss/.cache/rust-script/binaries/release/rust-script-test_83ff7425da238fd28ad88049
instead of the script name. Can this be changed? Should this be a separate issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions