zonemaster-cli icon indicating copy to clipboard operation
zonemaster-cli copied to clipboard

whitespace at the end of an option in ~/.zonemaster/cli.args causes failure

Open ondohotola opened this issue 9 months ago • 3 comments

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.

ondohotola avatar Mar 27 '25 22:03 ondohotola

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.

ondohotola avatar Mar 27 '25 22:03 ondohotola

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.

matsduf avatar Mar 28 '25 10:03 matsduf

I'll make a new issue out of the feature request

ondohotola avatar Mar 28 '25 10:03 ondohotola