whitespace at the end of an option in ~/.zonemaster/cli.args causes failure
If you have an option such as for example
--no-ipv6 (with space at the end)
instead of
--no-ipv6 (without space at the end)
in the ~/.zonemaster/cli.args
you get the error
Unknown option: no-ipv6
Besides that the error message is unhelpful (as one can't see the trailing space) trailing whitespace should be removable on loading.
While I am at it, it would be helpful to evaluate the ~ in ~/.zonemaster/cli.arg
ie
--profile=~/.zonemaster/profile.new.json
instead of the currently required
--profile=/Users/el/.zonemaster/profile.new.json on the Mac
or
--profile=/home/el/.zonemaster/profile.new.json on Linux
which would allow synchorization of the file with rsync or unison.
The classification T-Bug is for the first issue, i.e. where trailing space in cli.args file is not trimmed before interpretation.
The second issue I am unsure of. The expansion of ~ is normally done on the command line. When I test the following on the MacOS on the command line I get no expansion:
% echo --profile=~/.zonemaster/profile.new.json
--profile=~/.zonemaster/profile.new.json
If I replace "=" with " ", which is possible on the command line but not in cli.args I get expansion:
% echo --profile ~/.zonemaster/profile.new.json
--profile /Users/mats.dufberg/.zonemaster/profile.new.json
Today, if the cli.args has the following line
--profile=profile.new.json
and profile.new.json is in the same directory as cli.args, zonemaster-cli will not find the profile. A possible feature request could be that relative file names are looked for relativ cli.args. That could make sense.
I'll make a new issue out of the feature request