X-Git-Url: https://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/11dfda46d8834955846372602441bbcec6a9047f..a54ca32593545309dcb95870a1d69bf8fcf4b8d2:/t/msgfmt.sh diff --git a/t/msgfmt.sh b/t/msgfmt.sh new file mode 100755 index 0000000..6cb09ee --- /dev/null +++ b/t/msgfmt.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Copyright © 2023 Nick Bowler +# +# Fake msgfmt program for testing. +# +# License WTFPL2: Do What The Fuck You Want To Public License, version 2. +# This is free software: you are free to do what the fuck you want to. +# There is NO WARRANTY, to the extent permitted by law. + +outfile=messages.mo +for arg +do + arg=${lastarg:+"$lastarg="}$arg + lastarg= + + save_IFS=$IFS; IFS='=' + set x $arg; shift; shift; optarg=$* + IFS=$save_IFS + + case $arg in + -o|--output-file) lastarg=--output-file ;; + --output-file=*) outfile=$optarg ;; + esac +done + +exec 1>"$outfile"