Skip to content

Builder: accept --verify, --keep and --send-test-mail anywhere before -- - #60

Merged
modem7 merged 1 commit into
masterfrom
builder-opts-anywhere
Oct 23, 2026
Merged

modem7 merged 1 commit into
masterfrom
builder-opts-anywhere

Conversation

@modem7

@modem7 modem7 commented Oct 23, 2026

Copy link
Copy Markdown
Owner

What

The builder's own options only counted straight after the target. After the first other argument everything went to the create script, so ./build-templates.sh base --vmid 6001 --template --unattended --verify --send-test-mail me@example.com failed with Unknown argument: --verify from the create script.

Now --verify, --keep and --send-test-mail <addr> are recognised anywhere before a literal --, in any order relative to the create-script args. Every other argument after the target goes to the create script in order. A literal -- still ends option parsing: everything after it is passed through as it is, even --verify. The documented forms (base --verify -- --vmid 53000 ..., base -- ..., plain base) behave as before. Help, header comment and README updated.

Behaviour to know about: a create-script value that is one of the three option names (for example --hostname --keep) must now go after --. The create script has no --verify, --keep, --send-test-mail or --init options, so nothing clashes today. --init is also recognised anywhere before --, so base --vmid 1 --init is now the --init usage error instead of being passed on.

Testing

bash -n and shellcheck are clean. Argument parsing was checked on a copy that prints the parsed variables: the failing command above, options before and after --, --verify before the target, base -- --verify (passed through), plain base, --keep without --verify, --send-test-mail with no address, --init and --init base, an unknown target, --generate-only --verify. Real --help and --init still work.

Not run as root or on a Proxmox host, so no real build was started.

@modem7
modem7 merged commit 72bf6ac into master Oct 23, 2026
4 checks passed
@modem7
modem7 deleted the builder-opts-anywhere branch October 23, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant