]> git.ipfire.org Git - thirdparty/systemd.git/commit
shared/options: add new helper option_parser_get_arg
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Wed, 29 Apr 2026 10:20:58 +0000 (12:20 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Wed, 29 Apr 2026 13:28:05 +0000 (15:28 +0200)
commitab9acf8c8cf75906ebe0827c200f5bbd31f28580
treed6b805ef60cea38939a8a92f6cc81de6c9e0b316
parent408d18f4d215747f7eba352cff1ea3b8c14fb574
shared/options: add new helper option_parser_get_arg

option_parser_next_arg() is renamed to option_parser_peek_next_arg()
to match option_parser_consume_next_arg().

A new helper is added option_parser_get_arg(…, n). It is a common pattern
to only need a single arg, and getting an array and extracting a single
item from it is too verbose.
src/cryptenroll/cryptenroll.c
src/growfs/growfs.c
src/nspawn/nspawn.c
src/shared/options.c
src/shared/options.h
src/test/test-options.c