mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 17:22:07 +00:00
tools: ynl-gen-c: annotate valid choices for --mode
This makes argparse validate the input and helps users understand which modes are possible. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Link: https://patch.msgid.link/20241206113100.e2ab5cf6937c.Ie149a0ca5df713860964b44fe9d9ae547f2e1553@changeid Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
860dbab69a
commit
00ab246750
@ -2706,7 +2706,8 @@ def find_kernel_root(full_path):
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='Netlink simple parsing generator')
|
||||
parser.add_argument('--mode', dest='mode', type=str, required=True)
|
||||
parser.add_argument('--mode', dest='mode', type=str, required=True,
|
||||
choices=('user', 'kernel', 'uapi'))
|
||||
parser.add_argument('--spec', dest='spec', type=str, required=True)
|
||||
parser.add_argument('--header', dest='header', action='store_true', default=None)
|
||||
parser.add_argument('--source', dest='header', action='store_false')
|
||||
|
Loading…
Reference in New Issue
Block a user