]> git.draconx.ca Git - dxcommon.git/blob - t/msgfmt.sh
DX_C_ALIGNAS: Work around bash-5 parsing bug.
[dxcommon.git] / t / msgfmt.sh
1 #!/bin/sh
2 #
3 # Copyright © 2023 Nick Bowler
4 #
5 # Fake msgfmt program for testing.
6 #
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.
10
11 outfile=messages.mo
12 for arg
13 do
14   arg=${lastarg:+"$lastarg="}$arg
15   lastarg=
16
17   save_IFS=$IFS; IFS='='
18   set x $arg; shift; shift; optarg=$*
19   IFS=$save_IFS
20
21   case $arg in
22   -o|--output-file) lastarg=--output-file ;;
23   --output-file=*) outfile=$optarg ;;
24   esac
25 done
26
27 exec 1>"$outfile"