Skip to content

Commit 6a49f13

Browse files
update
1 parent 76cb5e2 commit 6a49f13

File tree

6 files changed

+17
-21
lines changed

6 files changed

+17
-21
lines changed
2.46 KB
Binary file not shown.
1.53 KB
Binary file not shown.
601 Bytes
Binary file not shown.
2.5 KB
Binary file not shown.

passmanager/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ def range_type(value_string):
1212
def parse_args(args):
1313
parser = argparse.ArgumentParser(
1414
usage="passmanager SITE [LOGIN] [MASTER_PASSWORD] [OPTIONS]",
15-
description=description,
16-
epilog=EXAMPLES + COPYRIGHT,
15+
description=open('./README.md').read(),
16+
# epilog=EXAMPLES + COPYRIGHT,
1717
formatter_class=argparse.RawDescriptionHelpFormatter,
1818
)
1919
parser.add_argument(
20-
"-v", "--version", action="version", version=version.__version__
20+
"-v", "--version", action="version", version='0.0.1'
2121
)
2222
parser.add_argument(
2323
"site", nargs="?", help="site used in the password generation (required)"
@@ -29,15 +29,15 @@ def parse_args(args):
2929
"master_password",
3030
default=os.environ.get("passmanager_MASTER_PASSWORD", None),
3131
nargs="?",
32-
help="master password used in password generation. Default to passmanager_MASTER_PASSWORD env variable or prompt.",
32+
help="master password used in password generation.",
3333
)
3434
parser.add_argument(
3535
"-L",
3636
"--length",
37-
default=16,
37+
default=10,
3838
choices=range(5, 35+1),
3939
type=range_type,
40-
help="password length (default: 16, min: 5, max: 35)",
40+
help="password length (default: 10, min: 5, max: 35)",
4141
metavar='[5-35]'
4242
)
4343
parser.add_argument(

passmanager/main.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import traceback
55
import signal
66

7-
from passmanager.cli import parse_args
8-
from passmanager.manager import create_profile
9-
from passmanager.password import generate_password
10-
from passmanager.clipboard import copy, get_system_copy_command
7+
from cli import parse_args
8+
from manager import create_profile
9+
from password import generate_password
10+
from clipboard import copy, get_system_copy_command
1111

1212
signal.signal(signal.SIGINT, lambda s, f: sys.exit(0))
1313

@@ -16,22 +16,21 @@ def main(args=sys.argv[1:]):
1616
args = parse_args(args)
1717
if args.clipboard and not get_system_copy_command():
1818
print(
19-
"ERROR To use the option -c (--copy) you need pbcopy on OSX, "
20-
+ "xsel, xclip, or wl-clipboard on Linux, and clip on Windows"
19+
"ERROR To use the option -c (--copy) "
2120
)
2221
sys.exit(3)
2322

2423
if args.prompt:
2524
args.site = getpass.getpass("Site: ")
2625
args.login = getpass.getpass("Login: ")
2726
if not args.site:
28-
print("ERROR argument SITE is required but was not provided.")
27+
print("ERROR : SITE is not given")
2928
sys.exit(4)
3029

3130
if not args.master_password:
3231
args.master_password = getpass.getpass("Master Password: ")
3332
if not args.master_password:
34-
print("ERROR argument MASTER_PASSWORD is required but was not provided")
33+
print("ERROR : MASTER_PASSWORD is required ")
3534
sys.exit(5)
3635

3736
profile, master_password = create_profile(args)
@@ -42,14 +41,11 @@ def main(args=sys.argv[1:]):
4241
copy(generated_password)
4342
print("Copied to clipboard")
4443
except Exception as e:
45-
print("Copy failed, we are sorry")
46-
print("Can you send us an email at [email protected]\n")
47-
print("-" * 80)
48-
print("Object: [passmanager][cli] Copy issue on %s" % platform.system())
49-
print("Hello,")
50-
print("I got an issue with passmanager cli software.\n")
44+
print("@" * 80)
45+
print("Copy issue occured on %s" % platform.system())
46+
print("Can you send us an email at [email protected]\n")
5147
traceback.print_exc()
52-
print("-" * 80)
48+
print("_" * 80)
5349
else:
5450
print(generated_password)
5551

0 commit comments

Comments
 (0)