From d010524e6b9dc01286b6d6dcf32930204d7b5ca8 Mon Sep 17 00:00:00 2001 From: Rob McMullen Date: Mon, 18 May 2015 23:23:38 -0700 Subject: [PATCH] Updated help text --- README.rst | 24 ++++++++++++++++++++++++ atrcopy.py | 13 +++++++------ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 3a74880..573ea64 100644 --- a/README.rst +++ b/README.rst @@ -31,6 +31,30 @@ To extract all non SYS files while converting to lower case, use:: File #8 : *ASTEROIDS 066 : copying to asteroid.s +Command Line Help +----------------- + +The built-in help in accessed with the standard ``--help`` argument:: + + $ python atrcopy.py --help + usage: atrcopy.py [-h] [-v] [-l] [--dry-run] [-n] [-x] [--xex] ATR [ATR ...] + + Extract images off ATR format disks + + positional arguments: + ATR an ATR image file [or a list of them] + + optional arguments: + -h, --help show this help message and exit + -v, --verbose + -l, --lower convert filenames to lower case + --dry-run don't extract, just show what would have been extracted + -n, --no-sys only extract things that look like games (no DOS or .SYS + files) + -x, --extract extract files + --xex add .xex extension + + Example on Mac OS X ------------------- diff --git a/atrcopy.py b/atrcopy.py index aa84178..7022666 100755 --- a/atrcopy.py +++ b/atrcopy.py @@ -235,14 +235,15 @@ if __name__ == "__main__": parser = argparse.ArgumentParser(description="Extract images off ATR format disks") parser.add_argument("-v", "--verbose", default=0, action="count") - parser.add_argument("-l", "--lower", action="store_true", default=False, help="Convert filenames to lower case") - parser.add_argument("--dry-run", action="store_true", default=False, help="Don't extract, just show what would have been extracted") - parser.add_argument("-n", "--no-sys", action="store_true", default=False, help="Only extract things that look like games (no DOS or .SYS files)") - parser.add_argument("-x", "--extract", action="store_true", default=False, help="Extract files") - parser.add_argument("--xex", action="store_true", default=False, help="Add .xex extension") + parser.add_argument("-l", "--lower", action="store_true", default=False, help="convert filenames to lower case") + parser.add_argument("--dry-run", action="store_true", default=False, help="don't extract, just show what would have been extracted") + parser.add_argument("-n", "--no-sys", action="store_true", default=False, help="only extract things that look like games (no DOS or .SYS files)") + parser.add_argument("-x", "--extract", action="store_true", default=False, help="extract files") + parser.add_argument("--xex", action="store_true", default=False, help="add .xex extension") + parser.add_argument("files", metavar="ATR", nargs="+", help="an ATR image file [or a list of them]") options, extra_args = parser.parse_known_args() - for args in extra_args: + for args in options.files: print args with open(args, "rb") as fh: atr = AtrDiskImage(fh)