Skip to content
/ argv Public

Non-allocating iterator over command line arguments

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

dtolnay/argv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Command line arguments by reference

github crates.io docs.rs build status

The standard library's std::env::args_os iterator produces an owned string (OsString) for each argument. In some use cases it can be more convenient for the arguments to be produced by static reference (&'static OsStr).

[dependencies]
argv = "0.1"

Example

fn main() {
    for arg in argv::iter() {
        // arg is a &'static OsStr.
        println!("{}", arg.to_string_lossy());
    }
}

Portability

This crate is intended to be used on Linux and macOS, on which command line arguments naturally live for the duration of the program. This crate implements the same API on other platforms as well, such as Windows, but leaks memory on platforms other than Linux and macOS.


License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Non-allocating iterator over command line arguments

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Languages