]> git.ipfire.org Git - thirdparty/systemd.git/commit
machinectl: convert to OPTION and VERB macros 42117/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Fri, 15 May 2026 17:19:15 +0000 (19:19 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Sat, 16 May 2026 13:59:15 +0000 (15:59 +0200)
commit3b37439afb88cfe55e111ad1a5421bd57405b3b9
tree6ee42b12bd5c2c474ce7cf017679b3f07fc7e21d
parentcab5c5ef8177a077e0b6f61bd31903e61ad2cc72
machinectl: convert to OPTION and VERB macros

For the shell verb we want switches specified after the program name to
be passed to the program to execute, not processed by us. Mirror the
approach in 'userdbctl ssh-authorized-keys': start with
OPTION_PARSER_RETURN_POSITIONAL_ARGS, then lates switch to
STOP_AT_FIRST_NONOPTION for "shell" or NORMAL otherwise.

VERB declarations are placed directly above each function; functions
that dispatch multiple verb names get stacked VERB() declarations.
chainload_importctl() now takes the args strv instead of relying on the
global optind.

--help output is mostly the same.
--no-pager/--no-legend/--no-ask-password/-q/--quiet are now at the end.
bind-volume/unbind-volume are documented.

Fixes c9f461a8067996c6b0c3ac3bf6f9097aedbf4734.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
src/machine/machinectl.c
test/units/TEST-13-NSPAWN.machined.sh