shared/verbs: turn verb argument specification into nulstr
Like the command-level CommandDescription.argspec, a verb's argspec is now a nulstr, so that a verb may declare multiple alternative usage lines. The verbs help table renders one synopsis line per nulstr entry in the synopsis cell. All verb argument specifications must gain an explicit NUL suffix. This is a lot of churn, but I think this needs to be done. For now, there'll be only one user of the new functionality (i.e. a verb with more than one argspec), but I think we'll eventually want to use this in other places too.
This commit is contained in:
@@ -303,7 +303,7 @@ COMMAND(
|
||||
.man_pages = "systemd-veritysetup@.service(8)\0",
|
||||
);
|
||||
|
||||
VERB(verb_attach, "attach", "VOLUME DATADEVICE HASHDEVICE ROOTHASH [OPTIONS]", 5, 6, 0,
|
||||
VERB(verb_attach, "attach", "VOLUME DATADEVICE HASHDEVICE ROOTHASH [OPTIONS]\0", 5, 6, 0,
|
||||
"Attach a verity-protected block device");
|
||||
static int verb_attach(int argc, char *argv[], uintptr_t _data, void *userdata) {
|
||||
_cleanup_(crypt_freep) struct crypt_device *cd = NULL;
|
||||
@@ -441,7 +441,7 @@ static int verb_attach(int argc, char *argv[], uintptr_t _data, void *userdata)
|
||||
return 0;
|
||||
}
|
||||
|
||||
VERB(verb_detach, "detach", "VOLUME", 2, 2, 0,
|
||||
VERB(verb_detach, "detach", "VOLUME\0", 2, 2, 0,
|
||||
"Detach a verity-protected block device");
|
||||
static int verb_detach(int argc, char *argv[], uintptr_t _data, void *userdata) {
|
||||
_cleanup_(crypt_freep) struct crypt_device *cd = NULL;
|
||||
|
||||
Reference in New Issue
Block a user