| Conditions | 2 | 
| Total Lines | 36 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 5 | ||
| Bugs | 0 | Features | 2 | 
| 1 | # -*- coding: utf-8 -*- | ||
| 28 | def parse_arguments(skip=False): | ||
| 29 | """Parse argument for label creator utility.""" | ||
| 30 | # Get command-line arguments | ||
| 31 | parser = argparse.ArgumentParser() | ||
| 32 | |||
| 33 | parser = add_common_parser_args(parser) | ||
| 34 | parser.add_argument( | ||
| 35 | '-a', | ||
| 36 | '--action', | ||
| 37 | help='Action to take', | ||
| 38 | type=str, | ||
| 39 | choices=['get', 'update'], | ||
| 40 | default='get', | ||
| 41 | nargs='?') | ||
| 42 | parser.add_argument( | ||
| 43 | '-f', | ||
| 44 | '--filename', | ||
| 45 | help='File for storing labels', | ||
| 46 | type=str, | ||
| 47 | default='labels.txt') | ||
| 48 | |||
| 49 | options = parser.parse_args() | ||
| 50 | |||
| 51 | username = options.username | ||
| 52 | password = parse_password_check_repo(options) | ||
| 53 | |||
| 54 | if not skip: | ||
| 55 | process_labels( | ||
| 56 | username, | ||
| 57 | password, | ||
| 58 | options.token, | ||
| 59 | options.action, | ||
| 60 | options.repository, | ||
| 61 | options.filename, ) | ||
| 62 | |||
| 63 | return options | ||
| 64 | |||
| 68 |