Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use --loop or --expr flags #52

Open
ryansname opened this issue Mar 1, 2018 · 4 comments
Open

Unable to use --loop or --expr flags #52

ryansname opened this issue Mar 1, 2018 · 4 comments

Comments

@ryansname
Copy link

I've tried copy pasting the scripts in the readme but get the following output:

echo Hello | cargo script --loop 'let mut n=0; move |l| {n+=1; println!("{:>6}: {}",n,l.trim_right())}'
error: The argument '--loop' cannot be used with one or more of the other specified arguments

USAGE:
    cargo script [FLAGS OPTIONS] [--] <script> <args>...

For more information try --help

The same thing occurs for -e:

cargo script -e 'println!("hello");'
error: The argument '--expr' cannot be used with one or more of the other specified arguments

USAGE:
    cargo script [FLAGS OPTIONS] [--] <script> <args>...

For more information try --help

Env:
Version: 0.2.8
OS: Archlinux
Shell: bash and zsh

@ryansname
Copy link
Author

ryansname commented Mar 3, 2018

It seems this happens when I've installed it via cargo install cargo-script but not when built locally.

Versions:
cargo-install, v0.2.8: Fails
tag v0.2.7: Works
614e60e 0.2.9: Works
e6992ae 0.2.8: Works, perhaps it's related to something cargo-install is doing?

@ryansname
Copy link
Author

If I delete the Cargo.lock from the repo version I get the same error.
Lead me to rust-lang/cargo#2263 which was recently implemented on nightly.

@ryansname
Copy link
Author

ryansname commented Mar 3, 2018

And a potential workaround:

git clone https:/DanielKeep/cargo-script.git
cd cargo-script
cargo install

@summivox
Copy link

summivox commented Apr 3, 2018

Can confirm same problem (and workaround) on Windows 10 + {PowerShell, Git Bash}.

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

No branches or pull requests

2 participants