Mercurial > public > enigma
changeset 28:067205259796
Correct name of command-line argument for key file.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 29 May 2012 17:21:16 -0500 |
parents | dc7f939a2ebf |
children | f8734f73baa8 |
files | enigma/main.py |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/enigma/main.py Tue May 29 17:12:42 2012 -0500 +++ b/enigma/main.py Tue May 29 17:21:16 2012 -0500 @@ -35,7 +35,7 @@ """ -def create_from_key_sheet(filename, day=None): +def create_from_key_file(filename, day=None): """Create an EnigmaMachine from a daily key sheet.""" with open(filename, 'r') as f: @@ -67,8 +67,8 @@ parser = argparse.ArgumentParser(description=PROG_DESC, epilog=HELP_EPILOG, formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('-k', '--key-sheet', - help='path to key sheet for daily settings') + parser.add_argument('-k', '--key-file', + help='path to key file for daily settings') parser.add_argument('-d', '--day', type=int, default=None, help='use the settings for day DAY when reading keysheet') parser.add_argument('-r', '--rotors', nargs='+', metavar='ROTOR', @@ -92,7 +92,7 @@ args = parser.parse_args() - if args.key_sheet and (args.rotors or args.ring_settings or args.plugboard + if args.key_file and (args.rotors or args.ring_settings or args.plugboard or args.reflector): parser.error("Please specify either a keysheet or command-line key " "settings, but not both") @@ -100,8 +100,8 @@ if args.start is None: parser.error("Please specify a start position") - if args.key_sheet: - machine = create_from_key_sheet(args.key_sheet, args.day) + if args.key_file: + machine = create_from_key_file(args.key_file, args.day) else: machine = create_from_args(parser, args)