-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
105 lines (84 loc) · 2.32 KB
/
cli.py
File metadata and controls
105 lines (84 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import argparse
import json
import os
import shutil
import site
import sys
import textwrap
import time
import warnings
from colorama import Fore, init
from config import Config, interactive, config_reader
from test import ultimate
init(autoreset=True)
def options():
'''
Parsing the Arguments here
'''
ap = argparse.ArgumentParser(
prog="projectpy",
usage="%(prog)s [options]",
formatter_class=argparse.RawDescriptionHelpFormatter,
description=textwrap.dedent('''SyncBoostNotes
=======================================
- A CLI to Sync your BoostNotes Notes -
=======================================
'''))
ap.add_argument("-l", "--location", required=True,
help="Location of the BoostNotes local storage.")
ap.add_argument(
"-c",
"--config",
required=False,
help="Location of the config.yaml/config.yml file",
default=True)
ap.add_argument(
"-col",
"--color",
required=False,
help="Toggle Colors on the print",
default=True)
ap.add_argument(
"-g",
"--generate",
required=False,
help="Generate config.yaml file for ya",
default=True)
ap.add_argument(
"-i",
"--interactive",
required=False,
help="Get an Interactive prompt to fill the forms.",
default=False)
return vars(ap.parse_args())
def initialize(args):
'''
Sets the Config for the installation
'''
if args['interactive']:
print('>>> Interactive <<<')
return interactive()
elif args['config']:
print('>>> CUSTOM <<<')
ultimate(config_reader('./config.yaml'))
else:
# ! Weird
raise Exception('Weird')
def main():
args = options()
initialize(args)
def run_as_command():
main()
run_as_command()
# print(
# '''
# _________________________________
# | |
# | Generation was successful |
# | Below is the generated config: |
# | ------------------------- |
# | $ cd repo_name |
# | $ python setup.py install |
# ------------------------------
# '''
# )