|
| 1 | +""" |
| 2 | +plangen command line argument definitions |
| 3 | +""" |
| 4 | + |
| 5 | +import argparse |
| 6 | + |
| 7 | +partitioning_strategies = ['windows', 'undefine1', 'undefined2'] # to be completed ????????????? |
| 8 | + |
| 9 | + |
| 10 | +def parse_arguments(): |
| 11 | + parser = argparse.ArgumentParser( |
| 12 | + description='feature-set partioning' |
| 13 | + ) |
| 14 | + |
| 15 | + parser.add_argument('--in_dir', |
| 16 | + type=str, |
| 17 | + help='Directory containing feature-set list files') |
| 18 | + |
| 19 | + parser.add_argument('--out_dir', |
| 20 | + default='results', |
| 21 | + type=str, |
| 22 | + help='Directory to contain generated plan files') |
| 23 | + |
| 24 | + parser.add_argument('--json', |
| 25 | + action='store_true', |
| 26 | + help='Generate plan in JSON format') |
| 27 | + |
| 28 | + parser.add_argument('--overwrite', |
| 29 | + action='store_true', |
| 30 | + help='Accept non-empty out_dir, contents overwritten') |
| 31 | + |
| 32 | + parser.add_argument('--partition_strategy', |
| 33 | + choices=partitioning_strategies, |
| 34 | + default=partitioning_strategies[0], |
| 35 | + help='Specify a feature-set partitioning strategy') |
| 36 | + |
| 37 | + # The following fs_* arguments are required, the number of values specified for each |
| 38 | + # must match, and at least two values are required for each |
| 39 | + |
| 40 | + parser.add_argument('--fs_names', |
| 41 | + required=True, |
| 42 | + type=str, |
| 43 | + nargs='+', |
| 44 | + help='Specify a list of (arbitrary) feature-set names') |
| 45 | + |
| 46 | + parser.add_argument('--fs_paths', |
| 47 | + required=True, |
| 48 | + type=str, |
| 49 | + nargs='+', |
| 50 | + help='Specify a list of feature-set file paths') |
| 51 | + |
| 52 | + parser.add_argument('--fs_parts', |
| 53 | + required=True, |
| 54 | + type=int, |
| 55 | + nargs='+', |
| 56 | + help='Specify a list of partition counts') |
| 57 | + |
| 58 | + parser.add_argument('--verbose', |
| 59 | + action='store_true', |
| 60 | + help='Verbosity') |
| 61 | + |
| 62 | + parser.add_argument('--debug', |
| 63 | + action='store_true', |
| 64 | + help='Data structure dumps, etc') |
| 65 | + |
| 66 | + parser.add_argument('--test', |
| 67 | + action='store_true', |
| 68 | + help='Test plan navigation and entry retrieval') |
| 69 | + |
| 70 | + parser.add_argument('--maxdepth', type=int, default=0) |
| 71 | + parser.add_argument('--print_tree', action='store_true') |
| 72 | + args = parser.parse_args() |
| 73 | + return args |
0 commit comments