scripts

various script and utils
git clone git://z3bra.org/scripts
Log | Files | Refs

commit e84a45be3e6a6b1516fda31ef60d0e68bc87f887
parent 7a7368cc872cb5c35cac412eea554435ae111e16
Author: z3bra <willy@mailoo.org>
Date:   Wed May  7 11:52:32 +0200

Added an option to delete a config file

Diffstat:
hmgr | 15+++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/hmgr b/hmgr @@ -20,16 +20,20 @@ color_dirs='0;33' # colors for directory names usage() { -echo "usage: $(basename $0) [-uh] [-l [dir]] [-ni <file>] [-csr <dir>]" +echo "usage: $(basename $0) [-hu] [-l [dir]] [-din <file>] [-csr <dir>]" test -z "$1" && return cat <<EOF -h : help -u : shortcut for -n ${USER}.h - -n <name> : deal with file as <name> (defaults to config.def.h) - -i <file> : input file to use (defaults to ./config.h) + -l [dir] : list currently managed applications/files + + -d <dir>/<name> : remove <name> from managed configs + -i <file> : input file to use (defaults to ./config.h) + -n <name> : deal with file as <name> (defaults to config.def.h) + -c <dir> : check which config is in use -s <dir> : store \`config.h\` to <dir> -r <dir> : restore \`config.h\` from <dir> @@ -95,7 +99,7 @@ LS_COLORS="di=${color_dirs}:*.h=${color_conf}" export LS_COLORS # Parse options -while getopts "chi:ln:s:r:u" opt; do +while getopts "chi:ld:n:s:r:u" opt; do case $opt in # Check which config is in use c) check;; @@ -104,6 +108,9 @@ while getopts "chi:ln:s:r:u" opt; do u) cout=${usercfg};; n) cout=${OPTARG};; + # Wipe the config given as argument + d) rm ${basedir}/$OPTARG;; + # Change the input file i) cin=$OPTARG;;