diff --git a/TODO.txt b/TODO.txt index 0e1dbc4..dba6d35 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,5 +1,3 @@ -- Add -h help and usage screen - Doc Notes --------- @@ -21,3 +19,5 @@ - Note differences between how serial numbers are appended on directories vs. files. + +- $TRM environment variable diff --git a/trm.sh b/trm.sh index cbbb664..dcb2adc 100755 --- a/trm.sh +++ b/trm.sh @@ -10,7 +10,6 @@ mkdir -p $GRAVEYARD - ##### # Display usage information ##### @@ -36,8 +35,16 @@ # be embedded in a shell startup script. ##### +# Pick up the environment variable settings if any, and go + trm() { + trm_go $TRM "$@" +} + + +trm_go() +{ # Parse command line args @@ -108,16 +115,17 @@ esac done + # Process rest of command line arguments + + shift $((OPTIND-1)) + # Notify if in test mode - if [ -n "${TESTMODE}" ] + if [ -n "${TESTMODE}" ] && [ $# -gt 0 ] then echo ${TESTMODE} fi - # Process arguments - - shift $((OPTIND-1)) while [ $# -gt 0 ] do