Skip to main content

Crate use_arg

Crate use_arg 

Source
Expand description

§use-arg

Primitive owned argument tokens for CLI-adjacent Rust code.

use-arg works at the token level. It can identify positional-looking tokens, the -- option separator, and flag-like tokens, but it does not parse a command line or define parser state.

§Example

use use_arg::{Arg, RawArgs, is_positional};

let input = Arg::from("README.md");
let args = RawArgs::from_iter([Arg::from("tool"), input.clone()]);

assert!(input.is_positional());
assert!(is_positional(input.as_str()));
assert_eq!(args.len(), 2);

§Scope

This crate intentionally avoids full parsing, subcommands, option schemas, and grouped flag expansion.

Modules§

prelude
Commonly used argument primitives.

Structs§

Arg
An owned command-line argument token.
RawArgs
A raw owned argument collection.

Functions§

is_flag_like
Returns whether a token looks like a flag or option token.
is_option_separator
Returns whether a token is the -- option separator.
is_positional
Returns whether a token looks positional.