Parse command-line arguments
()
| 42 | |
| 43 | |
| 44 | def parse_arguments(): |
| 45 | """Parse command-line arguments""" |
| 46 | parser = argparse.ArgumentParser( |
| 47 | description='ComfyUI Manager Node Scanner', |
| 48 | formatter_class=argparse.RawDescriptionHelpFormatter, |
| 49 | epilog=''' |
| 50 | Examples: |
| 51 | # Standard mode |
| 52 | python3 scanner.py |
| 53 | python3 scanner.py --skip-update |
| 54 | |
| 55 | # Scan-only mode |
| 56 | python3 scanner.py --scan-only temp-urls-clean.list |
| 57 | python3 scanner.py --scan-only urls.list --temp-dir /custom/temp |
| 58 | python3 scanner.py --scan-only urls.list --skip-update |
| 59 | ''' |
| 60 | ) |
| 61 | |
| 62 | parser.add_argument('--scan-only', type=str, metavar='URL_LIST_FILE', |
| 63 | help='Scan-only mode: provide URL list file (one URL per line)') |
| 64 | parser.add_argument('--temp-dir', type=str, metavar='DIR', |
| 65 | help='Temporary directory for cloned repositories') |
| 66 | parser.add_argument('--skip-update', action='store_true', |
| 67 | help='Skip git clone/pull operations') |
| 68 | parser.add_argument('--skip-stat-update', action='store_true', |
| 69 | help='Skip GitHub stats collection') |
| 70 | parser.add_argument('--skip-all', action='store_true', |
| 71 | help='Skip all update operations') |
| 72 | |
| 73 | # Backward compatibility: positional argument for temp_dir |
| 74 | parser.add_argument('temp_dir_positional', nargs='?', metavar='TEMP_DIR', |
| 75 | help='(Legacy) Temporary directory path') |
| 76 | |
| 77 | args = parser.parse_args() |
| 78 | return args |
| 79 | |
| 80 | |
| 81 | # Module-level variables (will be set in main if running as script) |