common/rc: handle option with argument in _require_xfs_io_command()
authorEric Biggers <ebiggers@google.com>
Mon, 3 Feb 2020 18:18:53 +0000 (10:18 -0800)
committerEryu Guan <guaneryu@gmail.com>
Mon, 17 Feb 2020 13:04:43 +0000 (21:04 +0800)
commit231f2465015560b8c3b049057169a95b7a3d54d8
treeafeb7224d3fd7cda1658dfb5acf452be00fa1ee7
parente7aab383558a5fa47dcd4f625df46ff5cc77d378
common/rc: handle option with argument in _require_xfs_io_command()

Fix _require_xfs_io_command() to handle options that take arguments when
the argument is shown in the help text.  E.g., it didn't work to run:

_require_xfs_io_command "add_enckey" "-k"

because the relevant line of the help text is:

-k KEY_ID -- ID of fscrypt-provisioning key containing the raw key

... but the grep command only matched "-k --", not "-k KEY_ID --".

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc