Skip to content
Snippets Groups Projects
Commit 196f3282 authored by ulif's avatar ulif
Browse files

Add --version option in option handler.

parent b967e100
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,10 @@ def handle_options(args):
type=argparse.FileType('r'),
help="Input wordlist. `-' will read from stdin.",
)
parser.add_argument(
'--version', action='store_true',
help='output version information and exit.',
)
parser.set_defaults(capitalize=True)
args = parser.parse_args(args)
return args
......
......@@ -157,6 +157,7 @@ class TestDicewareModule(object):
assert options.capitalize is True
assert options.specials == 0
assert options.infile is None
assert options.version is False
def test_handle_options_infile(self, tmpdir):
# we can give an infile
......@@ -167,6 +168,11 @@ class TestDicewareModule(object):
assert options.infile is not None
assert options.infile.read() == 'one\ntwo\n'
def test_handle_options_version(self):
# we can ask for version infos
options = handle_options(['--version', ])
assert options.version is True
def test_main(self, capsys):
# we can get a passphrase
main([]) # call with default options in place
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment