]> git.lizzy.rs Git - nhentai.git/blobdiff - nhentai/cmdline.py
Add the option to perform a dry-run and only download meta-data / generate file structure
[nhentai.git] / nhentai / cmdline.py
index 67140cd950a7f2f70e2e281d559020b8da038761..c7246d20d1e23f2425b726e5eaa8b363db09691c 100644 (file)
@@ -89,6 +89,7 @@ def cmd_parser():
     parser.add_option('--file',  '-f', type='string', dest='file', action='store', help='read gallery IDs from file.')
     parser.add_option('--format', type='string', dest='name_format', action='store',
                       help='format the saved folder name', default='[%i][%a][%t]')
+    parser.add_option('--dry-run', '-r', action='store_true', dest='dryrun', help='Dry run, skip file download.')
 
     # generate options
     parser.add_option('--html', dest='html_viewer', action='store_true',
@@ -214,4 +215,8 @@ def cmd_parser():
         logger.critical('Maximum number of used threads is 15')
         exit(1)
 
+    if args.dryrun and (args.is_cbz or args.is_pdf):
+        logger.critical('Cannot generate PDF or CBZ during dry-run')
+        exit(1)
+
     return args