vieet: list the sections of an eet file if a section isn't passed.

Thanks to Sachiel for suggesting this feature.
This commit is contained in:
Tom Hacohen 2014-10-23 15:28:30 +01:00 committed by Daniel Hirt
parent 5057cf31b3
commit 0042d3b2ea
1 changed files with 9 additions and 3 deletions

View File

@ -14,9 +14,17 @@ die() {
} }
usage() { usage() {
die "Usage: vieet <eet file> <section>" die "Usage: vieet <eet file> [section]"
} }
EETFILE="$1"
SECTION="$2"
if [ $# -eq 1 ]; then
eet -l "$EETFILE"
exit $?
fi
if [ $# -ne 2 ]; then if [ $# -ne 2 ]; then
usage usage
fi fi
@ -25,8 +33,6 @@ if [ -z "$EDITOR" ]; then
die "EDITOR env var must be set." die "EDITOR env var must be set."
fi fi
EETFILE="$1"
SECTION="$2"
TFILE=$(mktemp) TFILE=$(mktemp)
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then