lexopt
Minimalist pedantic command line parser
0.3.2
12M downloads/mo
#2803 most downloaded on crates.io
blyxxyz/lexopt
What this package is like to depend on
Last release 5 months ago
28 Feb 2026
Release timing varies
gaps range from 3 months to 2.2 years
Nearly every release is documented
notes for 6 of 6 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
6 releases · first in 2021
1 release in the last 12 months
see the full history below
Release timeline
6 releases · Jul 2021 to Feb 2026Releases
latest 6-
0.3.228 Feb 2026Release notes
Open source →New:
- Add
Parser::set_short_equals()to opt out of the nonstandard-o=valuesyntax. (#24)
Release notes
Open source →New:
- Add
Parser::set_short_equals()to opt out of the nonstandard-o=valuesyntax.
- Add
-
0.3.131 Mar 2025Release notes
Open source →New:
- Support the
wasm32-wasip2target. Previous releases failed to build.
Changes:
- Tweaked sanitization of invalid UTF-8 in option names to match
String::from_utf8_lossy(). - Removed special handling for WASI since WASI is de facto Unicode-only.
Release notes
Open source →New:
- Support the
wasm32-wasip2target.
Changes:
- Tweaked sanitization of invalid UTF-8 in options.
- Removed special handling for WASI since WASI is de facto Unicode-only.
- Support the
-
0.3.016 Jan 2023Release notes
Open source →This release adds a new preferred way to cast
OsStringintoString(.string()?) and makes raw argument processing more flexible.Almost no programs should need changes to keep working, but
.string()?makes it easier to use lexopt with other error types like anyhow's and using it is therefore recommended.New:
- Add
ValueExt::string()as the preferred method for converting fromOsStringintoString. UnlikeOsString::into_string()it has a normal error type so it's compatible with catch-all error types likeanyhow::Error. (#10)into_string()?will stay supported for the time being.
- Add
RawArgs::as_slice()for unlimited lookahead. (#15) - Add
Parser::try_raw_args()to get raw arguments without consuming any arguments in case of failure. Parsernow implementsClone,Send, andSync. ItsDebugoutput now shows the remaining arguments.
Changes:
- The input iterator is now consumed when you create a
Parser, instead of during parsing. This breaks certain clever code that inspects the state of the iterator, butRawArgs::as_slice()may provide an alternative. (If you don't know what this means then you aren't affected.) (#16) - Calling
Parser::values()no longer consumes any arguments if you don't use the iterator. RawArgs::peek()now takes&selfinstead of&mut self.
Release notes
Open source →This release adds a new preferred way to cast
OsStringintoString(.string()?) and makes raw argument processing more flexible.Almost no programs should need changes to keep working, but
.string()?makes it easier to use lexopt with other error types like anyhow's and using it is therefore recommended.New:
- Add
ValueExt::string()as the preferred method for converting fromOsStringintoString. UnlikeOsString::into_string()it has a normal error type so it's compatible with catch-all error types likeanyhow::Error.into_string()?will stay supported for the time being.
- Add
RawArgs::as_slice()for unlimited lookahead. - Add
Parser::try_raw_args()to get raw arguments without consuming any arguments in case of failure. Parsernow implementsClone,Send, andSync. ItsDebugoutput now shows the remaining arguments.
Changes:
- The input iterator is now consumed when you create a
Parser, instead of during parsing. This breaks certain clever code that inspects the state of the iterator, butRawArgs::as_slice()may provide an alternative. (If you don't know what this means then you aren't affected.) - Calling
Parser::values()no longer consumes any arguments if you don't use the iterator. RawArgs::peek()now takes&selfinstead of&mut self.
- Add
-
0.2.110 Jul 2022Release notes
Open source →New:
- Add
Parser::raw_args()for collecting raw unparsed arguments. (#12) - Implement
DebugforValuesIter.
Bug fixes:
- Change "missing argument at end of command" error message. (#11)
Release notes
Open source →New:
- Add
Parser::raw_args()for collecting raw unparsed arguments. (#12) - Implement
DebugforValuesIter.
Bug fixes:
- Change "missing argument at end of command" error message. (#11)
- Add
-
0.2.023 Oct 2021Release notes
Open source →While this release is not strictly backward-compatible it should break very few programs.
New:
- Add
Parser::values()for options with multiple arguments. - Add
Parser::optional_value()for options with optional arguments. - Add
Parser::from_iter()to construct from an iterator that includes the binary name. (#5) - Document how to use
Parser::value()to collect all remaining arguments.
Changes:
- Support
=as a separator for short options (as in-o=value). (#18) - Sanitize the binary name if it's invalid unicode instead of ignoring it.
- Make
Error::UnexpectedValue.optionaStringinstead of anOption<String>.
Bug fixes:
- Include
bin_nameinParser'sDebugoutput.
Release notes
Open source →While this release is not strictly backward-compatible it should break very few programs.
New:
- Add
Parser::values()for options with multiple arguments. - Add
Parser::optional_value()for options with optional arguments. - Add
Parser::from_iter()to construct from an iterator that includes the binary name. (#5) - Document how to use
Parser::value()to collect all remaining arguments.
Changes:
- Support
=as a separator for short options (as in-o=value). (#18) - Sanitize the binary name if it's invalid unicode instead of ignoring it.
- Make
Error::UnexpectedValue.optionaStringinstead of anOption<String>.
Bug fixes:
- Include
bin_nameinParser'sDebugoutput.
- Add
-
0.1.016 Jul 2021