[go: up one dir, main page]

Crate wild[][src]

Expand description

Emulates glob (wildcard) argument expansion on Windows. No-op on other platforms.

Unix shells expand command-line arguments like a*, file.??? and pass them expanded to applications. On Windows cmd.exe doesn’t do that, so this crate emulates the expansion there. Instead of std::env::args() use wild::args().

The glob syntax on Windows is limited to *, ?, and [a-z]/[!a-z] ranges. Glob characters in quotes ("*") are not expanded.

Parsing of quoted arguments precisely follows Windows native syntax (CommandLineToArgvW, specifically) with all its weirdness.

Usage

Use wild::args() instead of std::env::args() (or wild::args_os() instead of std::env::args_os()).

If you use Clap, use .get_matches_from(wild::args()) instead of .get_matches().

Modules

An optional, experimental low-level interface for parsing command-line strings from other sources. In most cases args and args_os are more appropriate.

Functions

Returns an iterator of glob-expanded command-line arguments. Equivalent of std::env::args().

Type Definitions

Iterator of arguments. Equivalent to std::env::Args. See args for details.

Same as Args, but keeps invalid Unicode intact.