summaryrefslogtreecommitdiff
path: root/bin/mkrc
diff options
context:
space:
mode:
authorGravatar Mike Burns <mike@mike-burns.com>2013-08-16 18:05:55 +0200
committerGravatar Mike Burns <mike@mike-burns.com>2013-08-16 18:05:55 +0200
commit6d0cc62494d23baad1ba015cb9dc01af4632102b (patch)
treeaeb27b3d89030262721e43780f09143795ffccd8 /bin/mkrc
parent971a2f9e5b2bcbfd0e1589dbd0dd602f7e2cd1c9 (diff)
Add -h for lsrc, mkrc, rcdn, rcup
Quick usage summaries for the four commands.
Diffstat (limited to 'bin/mkrc')
-rwxr-xr-xbin/mkrc15
1 files changed, 12 insertions, 3 deletions
diff --git a/bin/mkrc b/bin/mkrc
index 8cd2bd0..113c079 100755
--- a/bin/mkrc
+++ b/bin/mkrc
@@ -22,9 +22,17 @@ if [ -e $HOME/.rcrc ]; then
. $HOME/.rcrc
fi
+show_help() {
+ local exit_code=${1:-0}
+
+ $PRINT "Usage: mkrc [-hvqo] [-t TAG] [-d DIR] FILES ..."
+ $PRINT "see mkrc(1) and rcm(5) for more details"
+
+ exit $exit_code
+}
+
if [ $# -eq 0 ]; then
- echo "Usage: mkrc [-vqo] [-t tag] [-d dir] files ..."
- exit 1
+ show_help 1
fi
for DOTFILES_DIR in $DOTFILES_DIRS $DEFAULT_DOTFILES_DIR; do
@@ -37,9 +45,10 @@ in_host=0
version=0
always_copy=0
-while getopts CVvqot:d: opt; do
+while getopts ChVvqot:d: opt; do
case "$opt" in
C) always_copy=1 ;;
+ h) show_help ;;
t) tag=$OPTARG ;;
v) verbosity=$(($verbosity + 1)) ;;
q) verbosity=$(($verbosity - 1)) ;;