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§
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.