32 lines
711 B
Shell
Executable file
32 lines
711 B
Shell
Executable file
#!/bin/bash
|
|
|
|
# export so that we can use it in subscripts.
|
|
export UMBASEPATH=`realpath $0 | xargs dirname`
|
|
# TODO: load a config file?
|
|
export UMDEFAULTINIT='000.md'
|
|
|
|
# TODO: decide if getopts would be better. positional args supposed to be bad.
|
|
# https://stackoverflow.com/a/28466267
|
|
|
|
# catch first arguments with $1
|
|
case "$1" in
|
|
next)
|
|
$UMBASEPATH/next.sh $2 $3
|
|
;;
|
|
last)
|
|
$UMBASEPATH/last.sh
|
|
;;
|
|
cat)
|
|
# all args but first
|
|
$UMBASEPATH/cat.sh "${@:2}"
|
|
;;
|
|
rename)
|
|
$UMBASEPATH/rename.sh $2 $3
|
|
;;
|
|
tag)
|
|
$UMBASEPATH/tag.sh $2
|
|
;;
|
|
*)
|
|
echo "usage: um (next|last|cat|rename|tag)"; exit 1
|
|
;;
|
|
esac
|