-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·61 lines (48 loc) · 1.76 KB
/
main.py
File metadata and controls
executable file
·61 lines (48 loc) · 1.76 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
#!/usr/bin/env python
import argparse
from src.arguments.search import Search
version = "0.1.0"
parser = argparse.ArgumentParser()
parser.add_argument("-st",
"--start",
help="introduce you to dynamic",
action="store_true")
parser.add_argument("-s",
"--search",
help="search a question on StackOverflow",
action="store_true")
parser.add_argument("-V","-v",
"--version",
version=f"Dynamic-CLI version {version}",
action='version')
parser.add_argument(
"-n",
"--new",
help="Opens browser to create new StackOverflow question.",
const=True,
metavar="title (optional)",
nargs="?")
parser.add_argument("-file",
"--file",
help="Save answer to a file",
action="store_true")
parser.add_argument("-u",
"--update",
help="Check updates for the application",
action="store_true")
ARGV = parser.parse_args()
search_flag = Search(ARGV)
if __name__ == "__main__":
if ARGV.start:
print('''
\U0001F604 Hello and Welcome to Dynamic CLI
Use the following commands to get started
\U0001F50E to search StackOverflow, type 'dynamic -s'
\U0001F4C4 to create a new StackOverflow question in the Website, type 'dynamic -n [title(optional)]'
\U0001F4C2 to save answer inside a file, type 'dynamic -file'
\U00002728 to know the Version, type 'dynamic -V' or 'dynamic -v'
\U0001F609 to restart, type 'dynamic -st'
\U00002755 to get help, type 'dynamic -h'
''')
else:
search_flag.search_args()