-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmystack.py
24 lines (19 loc) · 853 Bytes
/
mystack.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import click
from services import *
# setting up command line options
@click.command()
@click.option('--screenshot', default='', help='Take a screenshot of query answer')
@click.option('--search', default='', help='Search your query(text)')
@click.option('--seekn', '-n', multiple=True , default='', help='Type your query(text) with position of answer to search within\n or \n -n Type your query -n question number -n screenshot to take screenshot of answer within')
def cli(screenshot, search, seekn):
if screenshot:
main(screenshot, 'screenshot')
elif search:
get_answers(search, 'search')
#elif seekn and n:
# nth_answer(n=seekn[1], question=seekn[0], option='screenshot')
elif seekn:
if len(seekn) == 3:
nth_answer(n=int(seekn[1]), question=seekn[0], option='screenshot')
else:
nth_answer(n=int(seekn[1]), question=seekn[0])