Skip to content

Commit

Permalink
Make not passing args in actually default to word_count=7
Browse files Browse the repository at this point in the history
  • Loading branch information
micahflee committed Oct 30, 2019
1 parent 62805c1 commit 5074b9c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion passphraseme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ def generate(filename, word_count=7):
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"word_count", metavar="word_count", default=7, type=int, help="Word count"
"word_count",
metavar="word_count",
nargs="?",
const=1,
default=7,
type=int,
help="Word count",
)
group = parser.add_mutually_exclusive_group()
group.add_argument(
Expand Down

0 comments on commit 5074b9c

Please sign in to comment.