argparse --help changes

This commit is contained in:
Leon Haag-Fank 2024-04-04 17:30:33 +02:00
parent 2bf591363e
commit b1c604626b

10
zeit-dl
View file

@ -11,15 +11,15 @@ MEINE = 'https://meine.zeit.de'
def main():
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('user', type=str, help='Username')
parser.add_argument('pwd', type=str, help='Password')
parser.add_argument('-o', '--out', type=str, default=os.getcwd(), help='Output directory')
parser.add_argument('-a', '--abo', type=str, choices=['diezeit', 'zeitcampus', 'zeit-audio'], default='diezeit', help='Abo')
parser.add_argument('-i', '--issue', type=str, help='Ausgabe (meistens DD.MM.YYYY)')
parser.add_argument('-t', '--type', type=str, choices=['pdf', 'epub', 'mp3'], default='pdf', help='Dateiformat')
parser.add_argument('-a', '--abo', type=str, choices=['diezeit', 'zeitcampus', 'zeit-audio'], default='diezeit', help='Subscription (part after abo/)')
parser.add_argument('-i', '--issue', type=str, help='Issue (mostly DD.MM.YYYY)')
parser.add_argument('-t', '--type', type=str, choices=['pdf', 'epub', 'mp3'], default='pdf', help='File type')
parser.add_argument('-f', '--force', action='store_true', help='Redownload file even if already present')
parser.add_argument('--format', type=str, default="{abo}_{issue}.{ext}", help='Filename format')
parser.add_argument('--format', type=str, default="{abo}_{issue}.{ext}", help='Filename format. Possible formatting strings are {abo}, {issue}, {ext} and datetime format codes.')
args = parser.parse_args()
if args.user is None or args.pwd is None:
parser.error('You need to supply a username and password')