| 264 | parser.add_argument(f'--{level}', dest='levels', |
| 265 | action='append_const', const=level) |
| 266 | def process_levels(args, *, argv=None): |
| 267 | levels = [] |
| 268 | for raw in args.levels or (): |
| 269 | for level in raw.replace(',', ' ').strip().split(): |
| 270 | if level == 'public': |
| 271 | levels.append('stable') |
| 272 | levels.append('cpython') |
| 273 | elif level == 'no-public': |
| 274 | levels.append('private') |
| 275 | levels.append('internal') |
| 276 | elif level in _capi.LEVELS: |
| 277 | levels.append(level) |
| 278 | else: |
| 279 | parser.error(f'expected LEVEL to be one of {sorted(_capi.LEVELS)}, got {level!r}') |
| 280 | args.levels = set(levels) |
| 281 | |
| 282 | parser.add_argument('--kinds', action='append', metavar='KIND[,...]') |
| 283 | for kind in _capi.KINDS: |