Skip to content

Commit f1f8985

Browse files
committed
Removed code indent from README
1 parent 97070d8 commit f1f8985

File tree

1 file changed

+53
-57
lines changed

1 file changed

+53
-57
lines changed

README.md

Lines changed: 53 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,31 @@ an argument as its only parameter and returns the value given to the argument.
1212
If the argument doesn't have a value or hasn't been passed nothing is returned.
1313

1414
```bash
15-
16-
# -a 'some text'
17-
if [ "$(argValue "a")" == 'some text' ]; then
18-
# Do something awesome
19-
fi
20-
21-
# --debug 3
22-
DEBUG_LEVEL="$(argValue "debug")" # 3
23-
24-
# -R 0
25-
[ "$(argValue "R")" == "0" ] && echo "Recursive depth 0"
26-
27-
# -aXb 'cookie'
28-
BISCUIT="$(argValue "b")" # 'cookie'
29-
30-
# -g 'hello' -G 'world'
31-
ALPHA="$(argValue "g")" # 'hello'
32-
BRAVO="$(argValue "G")" # 'world'
33-
34-
# -S d
35-
case $(argValue 'S') in
36-
a) echo "something" ;;
37-
b) echo "something" ;;
38-
c) echo "something" ;;
39-
d) echo "darkside" ;;
40-
esac
41-
15+
# -a 'some text'
16+
if [ "$(argValue "a")" == 'some text' ]; then
17+
# Do something awesome
18+
fi
19+
20+
# --debug 3
21+
DEBUG_LEVEL="$(argValue "debug")" # 3
22+
23+
# -R 0
24+
[ "$(argValue "R")" == "0" ] && echo "Recursive depth 0"
25+
26+
# -aXb 'cookie'
27+
BISCUIT="$(argValue "b")" # 'cookie'
28+
29+
# -g 'hello' -G 'world'
30+
ALPHA="$(argValue "g")" # 'hello'
31+
BRAVO="$(argValue "G")" # 'world'
32+
33+
# -S d
34+
case $(argValue 'S') in
35+
a) echo "something" ;;
36+
b) echo "something" ;;
37+
c) echo "something" ;;
38+
d) echo "darkside" ;;
39+
esac
4240
```
4341

4442
### Check If An Argument Has Been Passed
@@ -47,56 +45,54 @@ There is a helper function named `argExists()` which takes the name of
4745
an argument as its only parameter and returns a boolean.
4846

4947
```bash
50-
51-
# -v
52-
if argExists 'v'; then
53-
echo "The -v argument has been passed"
54-
fi
55-
56-
# -rMd
57-
argExists 'r' && echo "The -r argument was passed"
58-
59-
# --long-argument-name
60-
if argExists 'long-argument-name'; then
61-
# Do something awesome
62-
fi
63-
64-
# -O 43
65-
argExists 'r' && echo "Found the -O argument"
48+
# -v
49+
if argExists 'v'; then
50+
echo "The -v argument has been passed"
51+
fi
52+
53+
# -rMd
54+
argExists 'r' && echo "The -r argument was passed"
55+
56+
# --long-argument-name
57+
if argExists 'long-argument-name'; then
58+
# Do something awesome
59+
fi
6660

61+
# -O 43
62+
argExists 'r' && echo "Found the -O argument"
6763
```
6864

6965
## Supported Argument Formats
7066

7167
### Short Form
7268

7369
```bash
74-
-a
75-
-X
76-
-b somevalue
77-
-c 38
78-
-d "some value with spaces"
79-
-e "some value with
70+
-a
71+
-X
72+
-b somevalue
73+
-c 38
74+
-d "some value with spaces"
75+
-e "some value with
8076
newlines"
8177
```
8278

8379
### Long Form
8480

8581
```bash
86-
--debug
87-
--test mode0
88-
--test "all the code"
89-
--Case-Sensitive true
90-
--long-parameter
91-
--newline "
82+
--debug
83+
--test mode0
84+
--test "all the code"
85+
--Case-Sensitive true
86+
--long-parameter
87+
--newline "
9288
"
9389
```
9490

9591
### Chained Short Form Arguments
9692

9793
```bash
98-
-aih # Equivalent to -a -i -h
99-
-dav 4 # Equivalent to -d -a -v 4
94+
-aih # Equivalent to -a -i -h
95+
-dav 4 # Equivalent to -d -a -v 4
10096
```
10197

10298
## Argument Order

0 commit comments

Comments
 (0)