Skip to content

Commit edab31d

Browse files
committed
doc: update the readme.
1 parent 50097c1 commit edab31d

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1-
# cli
1+
# cli
2+
3+
A simple shell library with cli utilities.
4+
5+
## hasflag
6+
Checks if a flag is present in the arguments. Returns 'true' if its present, or nothing otherwise.
7+
8+
Example:
9+
10+
hasflag --help $*
11+
12+
## readopt
13+
Read the value of an option. It returns the next argument following the option.
14+
15+
Example:
16+
17+
readopt --log-level $*
18+
19+
## or
20+
Returns the first argument if not empty, the second otherwise.
21+
22+
value=$(or $candidate "default value")

0 commit comments

Comments
 (0)