Skip to content

Commit

Permalink
Add version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
wjandrea committed Apr 12, 2023
1 parent f93598f commit b3552e2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Options:
-n Provide more info if a command is not found.
Uses "/usr/lib/command-not-found" (available on Debian/Ubuntu)
-t Print only types, similar to "type -at".
-v Print the version and exit.
Exit Status:
4 - Missing dependency ("symlink-info" or optionally the "-n" handler)
Expand Down Expand Up @@ -203,6 +204,7 @@ Arguments:
Options:
-h Print this help message and exit.
-v Print the version and exit.
Info provided per symlink:
- target, recursively
Expand Down
7 changes: 6 additions & 1 deletion src/symlink-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Arguments:
Options:
-h Print this help message and exit.
-v Print the version and exit.
Info provided per symlink:
- target, recursively
Expand Down Expand Up @@ -50,12 +51,16 @@ basename=$(basename -- "$0") # For error messages and help
exit=0

OPTIND=1
while getopts :h OPT; do
while getopts :hv OPT; do
case $OPT in
h)
_help
exit 0
;;
v)
echo "symlink-info 0.2.0"
exit 0
;;
*)
printf >&2 '%s: Invalid option: -%s\n' \
"$basename" \
Expand Down
7 changes: 6 additions & 1 deletion src/what.sh
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ Options:
-n Provide more info if a command is not found.
Uses "/usr/lib/command-not-found" (available on Debian/Ubuntu)
-t Print only types, similar to "type -at".
-v Print the version and exit.
Exit Status:
4 - Missing dependency ("symlink-info" or optionally the "-n" handler)
Expand Down Expand Up @@ -416,7 +417,7 @@ function what { (
done

OPTIND=1
while getopts :dhint OPT; do
while getopts :dhintv OPT; do
case $OPT in
d)
print_definition=true
Expand All @@ -443,6 +444,10 @@ function what { (
t)
print_type_only=true
;;
v)
echo "what 0.2.0"
exit 0
;;
*)
printf >&2 '%s: %s: Invalid option: %s\n' \
"$basename" \
Expand Down

0 comments on commit b3552e2

Please sign in to comment.