Skip to content

Commit

Permalink
unifying
Browse files Browse the repository at this point in the history
- for readability and maintenance use `cat` instead of multiple `echo`
- similar variable order through the scripts
- set version to 0.9
  • Loading branch information
retokromer authored Feb 18, 2017
1 parent 525cfdb commit 1da13d3
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions lto2filemaker
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,32 @@
# Server using two tables called "lto_tapes" and "lto_files" with fields
# according to the LTFS XML format.

VERSION=0.1
VERSION="0.9"
SCRIPTDIR=$(dirname "${0}")
REQUIRECONFIG="Y"
DEPENDENCIES=(xml curl)
unset CURL_OPTS
VERBOSITY=0
SCRIPTDIR=$(dirname "${0}")

. "${SCRIPTDIR}/mmfunctions" || { echo "Missing '${SCRIPTDIR}/mmfunctions'. Exiting." ; exit 1 ; }

_usage(){
echo
echo "$(basename "${0}") ${VERSION}"
echo "This application will create a file suitable for broadcast or editing"
echo "from a video file or package input with the following options."
echo "Dependencies: ${DEPENDENCIES[@]}"
echo "Usage: $(basename "${0}") [-v|-h] LTFS_SCHEMA_FILE"
echo " -v N verbosity, 0 hides curl errors, default is 0"
echo " -h display this help"
echo
exit
}
cat <<EOF
$(basename "${0}") ${VERSION}
This application will create a file suitable for broadcast or editing
from a video file or package input with the following options.
Dependencies: ${DEPENDENCIES[@]}
Usage: $(basename "${0}") [-v | -h] LTFS_SCHEMA_FILE
-v N verbosity, 0 hides curl errors, default is 0
-h display this help
EOF}
[ "${#}" = 0 ] && _usage
OPTIND=1
while getopts ":v:h" opt ; do
case "${opt}" in
v) VERBOSITY="${OPTARG}" ;;
h) _usage ;;
h) _usage ; exit 0 ;;
:) echo "Error: Option -$OPTARG requires an argument" ; exit 1 ;;
*) echo "Error: Bad option -$OPTARG" ; _usage ; exit 1 ;;
esac
Expand Down

0 comments on commit 1da13d3

Please sign in to comment.