Hi Antonio,

On 2023-11-10 18:10, Antonio Terceiro wrote:
> Some shared options are defined in lib/environment.sh, I think that's
> why it currently loads lib/environment.sh before processing the command
> line options.
> 
> OTH your analysis is correct, as this causes the --config option to be
> useless. A solution to this would be to break the common options into
> their own file, include that in the scripts, call getopt, process
> --config before anything else, then load lib/environment.sh for default
> values, and only then process the rest of the options.

unless I'm misreading something badly, both default values *and* option
processing are in lib/environment.sh -- it's just that getopt is called
somewhat after some defaults have been set, like config_dir, arch, etc.

My gut says moving getopt to the top of lib/environment.sh would fix
this, but its current position seemed like a deliberate choice, so I
assumed I was missing something.

Best,
Christian

Reply via email to