File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,11 +69,13 @@ argExists 'r' && echo "Found the -O argument"
6969``` bash
7070-a
7171-X
72+ -2
7273-b somevalue
7374-c 38
7475-d " some value with spaces"
7576-e " some value with
7677newlines"
78+ -7 " ate nine"
7779```
7880
7981### Long Form
@@ -86,13 +88,16 @@ newlines"
8688--long-parameter
8789--newline "
8890"
91+ --1337
92+ --365 " days"
8993```
9094
9195### Chained Short Form Arguments
9296
9397``` bash
9498-aih # Equivalent to -a -i -h
9599-dav 4 # Equivalent to -d -a -v 4
100+ -H3cx # Equivalent to -H -3 -c -x
96101```
97102
98103## Argument Order
Original file line number Diff line number Diff line change 11#! /bin/bash
22
33# Define the regex for matching the arguments
4- regexArgShort=' ^-([a-zA-Z ])$'
5- regexArgShortChained=' ^-([a-zA-Z ]{2,})$'
6- regexArgLong=' ^--([a-zA-Z \-]{2,})$'
4+ regexArgShort=' ^-([a-zA-Z0-9 ])$'
5+ regexArgShortChained=' ^-([a-zA-Z0-9 ]{2,})$'
6+ regexArgLong=' ^--([a-zA-Z0-9 \-]{2,})$'
77
88argChunks=()
99
You can’t perform that action at this time.
0 commit comments