···20202121A plain argument such as `arg` is a required argument, which will be passed to the script as a positional argument.
22222323-An argument starting with `$` such as `$arg` is an optional argument, which will be passed to the script as an environment variable like `$ARGSH_ARG`, where all `-` get converted to `_`.
2323+An argument starting with `#` such as `#arg` is an optional argument, which will be passed to the script as an environment variable like `$ARGSH_ARG`, where all `-` get converted to `_`.
24242525An argument starting with `?` such as `?arg` is a flag, which will be passed to the script as an environment variable like `$ARGSH_ARG`, where all `-` get converted to `_`, with the value set to `1`, the value is irrelevant, just check if the variable is empty.
2626
+1-1
src/main.rs
···5757 let mut pos: u8 = 0;
58585959 for arg in args_raw.split(';') {
6060- if let Some(arg) = arg.strip_prefix('$') {
6060+ if let Some(arg) = arg.strip_prefix('#') {
6161 if is_valid_name(arg) {
6262 args.push(Arg::Optional(arg.to_owned()));
6363 } else {
+1-1
test
···11-#!./target/debug/argsh bash|required;also-required;?flag;$optional;$second-optional
11+#!./target/debug/argsh bash|required;also-required;?flag;#optional;#second-optional
2233echo "--required on pos 1: $1"
44echo "--also-required on pos 2: $2"