Crates.io | zeroarg |
lib.rs | zeroarg |
version | 0.1.0 |
source | src |
created_at | 2024-03-04 01:48:47.680516 |
updated_at | 2024-03-04 01:48:47.680516 |
description | A zero-setup commandline argument parser |
homepage | https://github.com/Torm/zeroarg |
repository | https://github.com/Torm/zeroarg |
max_upload_size | |
id | 1161115 |
size | 9,547 |
Zeroarg is a zero-setup commandline argument parser. It determines operands, attributes and flags purely from syntax. However, it makes stronger assumptions and is stricter about syntax than other parsers.
Use the parse_arguments
function to get a Vec
of operands, flags and attributes.
=
is always required for values, even for
short options.+
.--
, +
.-
.=
.operand
--flag
+flag
A short flag consists of a single character. It can be prefixed by a single -
.
-f
Multiple flags in the same argument can be delimited by +
. In such cases, the
argument does not require a prefix.
--flag1+flag2
+flag1+flag2
flag1+flag2
-abc
--attribute=value
+attribute=value
attribute=value
A short attribute consists of a single character. It can be prefixed by a single -
.
-a=value
--flag1+flag2+attribute=value
+flag1+flag2+attribute=value
flag1+flag2+attribute=value
Here, a
and b
are flags and c
is an attribute.
-abc=value
Any argument after an operand delimiter is parsed as an operand.
-
--
+