This repository was archived by the owner on Nov 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from daveygit2050/FR-18-application
FR-18 Add CLI application
- Loading branch information
Showing
3 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import argparse | ||
|
||
from . import phrases | ||
|
||
|
||
def get_args(): | ||
parser = argparse.ArgumentParser(description="Generate memorable passphrases") | ||
parser.add_argument('--max-word-length', | ||
default=8, | ||
dest='max_word_length', | ||
help="The maximum length of each word (default 8)", | ||
type=int) | ||
parser.add_argument('--minimum-length', | ||
default=6, | ||
dest='minimum_length', | ||
help="Minimum length of the phrase (default 16)", | ||
type=int) | ||
parser.add_argument('--separator', | ||
default=' ', | ||
dest='separator', | ||
help="What to put inbetween the words (default space)" | ||
) | ||
parser.add_argument('--word-count', | ||
default=4, | ||
dest='word_count', | ||
help="How many words to include in the phrase (default 4)", | ||
type=int) | ||
return parser.parse_args() | ||
|
||
|
||
def run(): | ||
args = get_args() | ||
print(phrases.generate( | ||
max_word_length=args.max_word_length, | ||
minimum_length=args.minimum_length, | ||
separator=args.separator, | ||
word_count=args.word_count | ||
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
from setuptools import setup, find_packages | ||
|
||
setup(name='fraise', | ||
version='1.3.0', | ||
version='1.4.0', | ||
description='Generate memorable pass phrases', | ||
url='http://github.com/daveygit2050/fraise', | ||
author='Dave Randall', | ||
author_email='[email protected]', | ||
license='Apache v2', | ||
packages=find_packages(exclude=('tests', 'docs', 'target')), | ||
zip_safe=False) | ||
zip_safe=False, | ||
entry_points={'console_scripts': ['fraise=fraise.application:run']}) |