Changed exit code, add correctness check
This commit is contained in:
parent
90d5f35043
commit
f065642278
@ -22,7 +22,7 @@ while true; do
|
|||||||
;;
|
;;
|
||||||
--)
|
--)
|
||||||
shift
|
shift
|
||||||
continue
|
break
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
break
|
break
|
||||||
@ -36,7 +36,7 @@ readonly stoptime="${3}"
|
|||||||
readonly outfile="${4}"
|
readonly outfile="${4}"
|
||||||
readonly format="${1%.*}"
|
readonly format="${1%.*}"
|
||||||
|
|
||||||
[[ -z "${infile}" ]] && printf '%s\n' "No file entered." >&2 exit 1
|
[[ -z "${infile}" ]] && printf '%s\n' "No file entered." >&2 exit 2
|
||||||
[[ ! -f "${infile}" ]] && printf '%s\n' "Not a file: ${infile}" >&2 exit 2
|
[[ ! -f "${infile}" ]] && printf '%s\n' "Not a file: ${infile}" >&2 exit 3
|
||||||
|
|
||||||
ffmpeg -i "${infile}" -ss "${starttime}" -to "${stoptime}" -c copy "${outfile:-"${outfile%.*}-trimmed.${format}"}"
|
ffmpeg -i "${infile}" -ss "${starttime}" -to "${stoptime}" -c copy "${outfile:-"${outfile%.*}-trimmed.${format}"}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user