-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
71 lines (61 loc) · 1.05 KB
/
cli.py
File metadata and controls
71 lines (61 loc) · 1.05 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
"""
Author: masakokh
Version: 1.0.0
Note: library
"""
# built-in
import sys, getopt
from typing import Any
# external
from smileargs.SmileArgs import SmileArgs
# internal
from smilelog.Controller import Controller
def main(argv) -> None:
#
controller = Controller()
smile = SmileArgs(
allowNoValue = False
, duplicated = False
, console = True
, debug = True
)
# path
smile.addCommand(
shortCommand = 'p'
, longCommand = 'path'
, description = 'file path'
)
# delete
smile.addCommand(
shortCommand = 'd'
, longCommand = 'delete'
, description = 'delete file'
)
# clean
smile.addCommand(
shortCommand = 'c'
, longCommand = 'clean'
, description = 'clean file'
)
# run command
smile.run()
#
cmdList = smile.catchCommand()
path = ''
#
for cmd in cmdList:
# find only path
# cmd.id
if cmd.value == 1:
path = smile.getCommand()
# found
for cmd in cmdList:
if cmd == 2:
pass
elif cmd == 4:
pass
if __name__ == '__main__':
"""
"""
#
main(sys.argv[1:])