Crate flood_tide
source ·Expand description
Command line flag and option parse utilities.
§Features
no_std
andstd
are supported.- flags, options, subcommand and free arguments
- short flags and options (like
-a
) - long flags and options (like
--long
) - combined short flags (like
-abc
::=-a
-b
-c
) - single long options (like
-long
) - abbreviate long options (like
--abbr
::=--abbreviate
) - single error or multiple errors
- only UTF-8 arguments
- it can be used optimally by a compile switch with many features.
- minimum support rustc 1.56.1 (59eed8a2a 2021-11-01)
§Todos
- multiple errors
-
no_std
- option suggestion (do you mean? ‘–abc’)
-
windows style (like
/a
) - source code generator support tools
- more easy use
§Non-Supports
- procedural macro style
- traditional macro style
- non UTF-8 arguments, multibyte or wide charactor
§Examples
in examples directory.
- manual coding style: bsd-sed.rs, gnu-cat.rs
- single long options: ffmpeg.rs
- source code generating by xtask and parse_simple_gnu_style(): curl.rs
§Supports
- flood-tide-gen - the generating flood-tide tables
- aki-gsub - the sample used flood-tide
§Alternatives
This parser is not a new special idea. It’s just comparing characters one by one. Is there anything simpler than this?
Re-exports§
pub use err::OptParseError;
pub use err::OptParseErrors;
pub use err::OptParseErrorKind;
Modules§
- Parse tables checking utilities for test.
- Parse error module.
Structs§
- Lexical analyzer
- Entity as the result of lex
- Record type of opt ary table
- Tokens as the result of lex
Enums§
- Option argument
Traits§
- check help and version of conf
- setter subcmd of conf
Functions§
- Parse simple gnu style.
- Parse simple gnu style with sub command.
Type Aliases§
- Option parse error type
- Option number type