Limit the choice of the targets argument to target we know about.
By limiting the choices in the argument parser, we catch argument error at parsing and we can provide useful output (the names of dependencies we can handle) to user in the help or in the error message.
This commit is contained in:
parent
82625ed62e
commit
e816979d51
|
@ -780,7 +780,8 @@ class Builder:
|
|||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('targets', default='kiwix-tools', nargs='?')
|
||||
parser.add_argument('targets', default='kiwix-tools', nargs='?',
|
||||
choices=Dependency.all_deps.keys())
|
||||
parser.add_argument('--working-dir', default=".")
|
||||
parser.add_argument('--libprefix', default=None)
|
||||
parser.add_argument('--target-platform', default="native_dyn", choices=BuildEnv.target_platforms)
|
||||
|
|
Loading…
Reference in New Issue