summaryrefslogtreecommitdiff
path: root/bin/lsrc
diff options
context:
space:
mode:
Diffstat (limited to 'bin/lsrc')
-rwxr-xr-xbin/lsrc12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/lsrc b/bin/lsrc
index 1ea2e2c..6f719e3 100755
--- a/bin/lsrc
+++ b/bin/lsrc
@@ -195,6 +195,15 @@ is_excluded() {
return 1
}
+show_help() {
+ local exit_code=${1:-0}
+
+ $PRINT "Usage: lsrc [-FVqvh] [-I EXCL_PAT] [-x EXCL_PAT] [-t TAG] [-d DOT_DIR]"
+ $PRINT "see lsrc(1) and rcm(5) for more details"
+
+ exit $exit_code
+}
+
handle_command_line() {
local arg_tags=
local verbosity=0
@@ -204,9 +213,10 @@ handle_command_line() {
local excludes=
local includes=
- while getopts FVqvI:x:t:d: opt; do
+ while getopts FVqvhI:x:t:d: opt; do
case "$opt" in
F) show_sigils=1;;
+ h) show_help ;;
I) includes="$includes $OPTARG";;
t) arg_tags="$arg_tags $OPTARG";;
v) verbosity=$(($verbosity + 1));;