dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 3301d035289760a4ed264e4a943479293eb21d90
parent 533c7bd19977fd918ae5da44b85cf78a99c93026
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Tue,  9 Jun 2020 16:17:00 +0200

Fix argument parsing

Diffstat:
M.local/bin/ffmpeg-split | 22+++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/.local/bin/ffmpeg-split b/.local/bin/ffmpeg-split @@ -13,6 +13,17 @@ die() { exit 1 } +artist="" +album="" +while :; do + case "$1" in + -a) artist="$2"; shift;; + -A) album="$2"; shift;; + *) break + esac + shift +done + if [ $# -ne 2 ]; then usage fi @@ -25,17 +36,6 @@ if [ ! -e "$1" ] || [ ! -e "$2" ]; then die "could not read $1 or $2" fi -artist="" -album="" -while :; do - case "$1" in - -a) artist="$2"; shift;; - -A) album="$2"; shift;; - *) break - esac - shift -done - i=1 tracks="$(awk 'END{ print NR }' "$1")" while [ "$i" -le "$tracks" ]; do