| |
---|
| | # Copyright (c) 2016 TundraWare Inc., Des Plaines, IL USA |
---|
| | # All Rights Reserved |
---|
| | # Permission granted for the free use of this program without restriction |
---|
| | |
---|
| | COPYRIGHT='2016' |
---|
| | GITID='a6ec7e4 tundra Thu Oct 27 18:35:24 2016 -0500' |
---|
| | VERSION='1.101' |
---|
| | |
---|
| | GRAVEYARD="${HOME}/.graveyard" |
---|
| | INTERPROMPT="Do You Want To Remove(Copy):" |
---|
| | TESTING="Test Mode ..." |
---|
| | |
---|
| |
---|
| | ##### |
---|
| | |
---|
| | trm_usage() |
---|
| | { |
---|
| | echo "usage: trm.sh -cehistvx -g graveyard [file|dir] ..." |
---|
| | echo "trm.sh ${VERSION} - Copyright (c) ${COPYRIGHT} , TundraWare Inc. All Rights Reserved." |
---|
| | echo "http://www.tundraware.com/Software/trm" |
---|
| | echo "" |
---|
| | echo "Usage: trm.sh -cehinstvx -g graveyard [file|dir] ..." |
---|
| | echo " where," |
---|
| | echo " -c copy targets to graveyard, don't remove them" |
---|
| | echo " -e empty the current graveyard (permanent removal)" |
---|
| | echo " -h display this help screen" |
---|
| | echo " -g graveyard use named graveyard instead of default" |
---|
| | echo " -i interactive removal/copy" |
---|
| | echo " -n noisy output - verbose mode" |
---|
| | echo " -s don't generate serial number suffixes" |
---|
| | echo " -t test mode, just show what would be done" |
---|
| | echo " -v verbose mode - noisy output" |
---|
| | echo " -x execute, overrides previous -t" |
---|
| | } |
---|
| | |
---|
| | |
---|
| |
---|
| | { |
---|
| | |
---|
| | # Parse command line args |
---|
| | |
---|
| | OPTLIST='ceg:histvx' # List of all legal command line options |
---|
| | OPTLIST='ceg:hinstvx' # List of all legal command line options |
---|
| | OPTIND=1 # in case getopts was previously used in this context |
---|
| | |
---|
| | # Defaults |
---|
| | |
---|
| |
---|
| | i) |
---|
| | INTERACTIVE="Yes" |
---|
| | ;; |
---|
| | |
---|
| | # Be noisy |
---|
| | n) |
---|
| | VERBOSE="-v" |
---|
| | ;; |
---|
| | |
---|
| | # Turn of serial number generation |
---|
| | s) |
---|
| | SERIALNO="" |
---|
| | ;; |
---|
| |
---|
| | t) |
---|
| | TESTMODE=${TESTING} |
---|
| | ;; |
---|
| | |
---|
| | # Be noisy |
---|
| | # Print git commit ID |
---|
| | v) |
---|
| | VERBOSE="-v" |
---|
| | echo ${GITID} |
---|
| | ;; |
---|
| | |
---|
| | # Actually execute |
---|
| | x) |
---|
| |
---|
| | |