# HG changeset patch # User Brian Neal # Date 1338330076 18000 # Node ID 06720525979665362630a9d51021869ce5974e44 # Parent dc7f939a2ebf3340646d9122be264279adba1e66 Correct name of command-line argument for key file. diff -r dc7f939a2ebf -r 067205259796 enigma/main.py --- 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)