Skip to content

Commit

Permalink
Refactor help screen
Browse files Browse the repository at this point in the history
  • Loading branch information
remino committed Sep 25, 2022
1 parent 18f6157 commit 4893ec2
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions vidmod
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ vidmod_main() {
d) outputdir="$OPTARG" ;;
f) ffmpeg_extra_opts="$OPTARG" ;;
o) final="$OPTARG" ;;
h) vidmod_usage && return ;;
h) vidmod_help && return ;;
v) vidmod_version && return ;;
*) vidmod_usage && return $e_args ;;
*) vidmod_help && return $e_args ;;
esac
done

Expand Down Expand Up @@ -70,6 +70,27 @@ vidmod_main() {
done
}

vidmod_help() {
cat << USAGE
$scriptname $VERSION
Usage: $scriptname [options] change1 [change2...] input
Do rapid changes to video files using ffmpeg or other tools.
Changes: 60fps, butter, crossfade, loop, mp4, mute, reverse, slowdown, twitter
Options:
-d Output directory. Defaults to directory of input file.
-o Last output file. When specified, any intermediate file will
be temporary.
-h Show this help screen.
-v Show version.
USAGE
}

vidmod_169() {
# shellcheck disable=SC2086
ffmpeg -i "$input" $ffmpeg_opts -vf "setdar=16/9" "$output"
Expand Down Expand Up @@ -163,24 +184,6 @@ vidmod_twitter() {
"$output"
}

vidmod_usage() {
echo "$scriptname $VERSION"
echo
echo "Usage: $scriptname [options] change1 [change2...] input"
echo
echo "Do rapid changes to video files using ffmpeg or other tools."
echo
echo "Changes: 60fps, butter, crossfade, loop, mp4, mute, reverse, slowdown, twitter"
echo
echo "Options:"
echo
echo " -d Output directory. Defaults to directory of input file."
echo " -o Last output file. When specified, any intermediate file will"
echo " be temporary."
echo " -h This help screen."
echo
}

vidmod_version() {
echo "$scriptname $VERSION"
}
Expand Down

0 comments on commit 4893ec2

Please sign in to comment.