test-tap.at: Fix regression passing program arguments.
[dxcommon.git] / t / msgfmt.sh
blob6cb09ee6b444afd4bf2bfe70f43bd7c2b09e924a
1 #!/bin/sh
3 # Copyright © 2023 Nick Bowler
5 # Fake msgfmt program for testing.
7 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
8 # This is free software: you are free to do what the fuck you want to.
9 # There is NO WARRANTY, to the extent permitted by law.
11 outfile=messages.mo
12 for arg
14 arg=${lastarg:+"$lastarg="}$arg
15 lastarg=
17 save_IFS=$IFS; IFS='='
18 set x $arg; shift; shift; optarg=$*
19 IFS=$save_IFS
21 case $arg in
22 -o|--output-file) lastarg=--output-file ;;
23 --output-file=*) outfile=$optarg ;;
24 esac
25 done
27 exec 1>"$outfile"