#!/bin/env bash set -e LONG_ARGUMENTS=( "output:" "debug" "help" ) SHORT_ARGUMENTS=( "o:" "d" "h" ) OPTS=$(getopt \ --longoptions "$(printf "%s," "${LONG_ARGUMENTS[@]}")" \ --options "$(printf "%s," "${SHORT_ARGUMENTS[@]}")" \ --name "$(basename "${0}")" \ -- "${@}" ) eval set -- "${OPTS}" ### Utility functions ### print_help() { echo "$(basename "${0}") [FLAGS...] FOLDER Parameters: -d --debug Enable debug output -h --help This very help " } err() { echo "${@}" >&2 } create_demuxer_file() { local demuxer_file="$(mktemp)" local entry_template=<> "${demuxer_file}" file '${img_to_demux}' duration ${random_duration} EOF done echo "file '${last_img}'" >> "${demuxer_file}" } ######################## ### Config ### VIDEO_TITLE="output" MAX_PHOTO_DURATION_SECONDS=10 ############## while [[ $# -gt 0 ]]; do case "${1}" in --debug) set -x shift 1 ;; -d) set -x shift 1 ;; --help) print_help exit 0 ;; -h) print_help exit 0 ;; --) shift 1 break ;; esac done INPUT_FOLDER="${1}" shift 1