addrom

Simple tool for adding a rom entry to a Pandora's Box 3 list.dat
Log | Files | Refs | LICENSE

commit 3ea0ab1f799f57a253d807aaa232b06e074cdf56
parent 0e55f2dbd08da6499cfffc19b479f05d20c6ff4d
Author: Quentin Rameau <quinq@fifth.space>
Date:   Wed, 11 Nov 2015 00:23:12 +0100

Added option to the csv script for toggling titles

Diffstat:
addrom-processcsv.sh | 22++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/addrom-processcsv.sh b/addrom-processcsv.sh @@ -3,24 +3,30 @@ ADDROMCMD="addrom" OPTIND=1 +cflag=0 +eflag=0 iflag= -oflag= ifile= +oflag= ofile= usage() { - printf "usage: %s %s %s %s %s\n" "$(basename $0)" \ - "-i input-list-file" "[-o output-list-file]" \ + printf "usage: %s %s %s %s %s %s %s\n" "$(basename $0)" \ + "-c" "-e" "-i input-list-file" "[-o output-list-file]" \ "[--]" "csv-game-list-file" - printf " %s %s %s %s %s\n" "$(basename $0)" \ - "[-i input-list-file]" "-o output-list-file" \ + printf " %s %s %s %s %s %s %s\n" "$(basename $0)" \ + "-c" "-e" "[-i input-list-file]" "-o output-list-file" \ "[--]" "csv-game-list-file" } -while getopts "i:o:" flag +while getopts "cei:o:" flag do case "$flag" in + c) cflag=1 + ;; + e) eflag=1 + ;; i) iflag=1 ifile="$OPTARG" ;; @@ -62,8 +68,8 @@ do printf "Skipping \"%s\", \"%s\": rom name empty\n" \ "$chname" "$enname" fi - [ -n "$chname" ] && chopt="-c$chname" || chopt= - [ -n "$enname" ] && enopt="-e$enname" || enopt= + [ "$cflag" -eq 1 ] && [ -n "$chname" ] && chopt="-c$chname" || chopt= + [ "$eflag" -eq 1 ] && [ -n "$enname" ] && enopt="-e$enname" || enopt= $ADDROMCMD -i "$ifile" "$chopt" "$enopt" -r "$romname" done < "$csvfile"