This repository has been archived by the owner on May 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
argsparser.py
72 lines (60 loc) · 1.6 KB
/
argsparser.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
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
'''
Parse command line arguments
'''
from argparse import ArgumentParser
class ArgsParser:
'''
Parse command line arguments
'''
def __init__(self):
self.parser = ArgumentParser(
description='file transfer system for SCOW'
)
def get_args_parser(self) -> ArgumentParser:
'''
Get the argument parser
@return: the argument parser
'''
# address
self.parser.add_argument(
'-a', '--address',
type=str,
help='address of the server'
)
# user
self.parser.add_argument(
'-u', '--user',
type=str,
help='username for logging in to the server'
)
# source path
self.parser.add_argument(
'-s', '--source',
type=str,
help='path to the source file or directory'
)
# directory path
self.parser.add_argument(
'-d', '--destination',
type=str,
help='path to the destination directory'
)
# max-depth
self.parser.add_argument(
'-m', '--max-depth',
type=int,
help='max depth of the directory'
)
# ssh port
self.parser.add_argument(
'-p', '--port',
type=int,
help='ssh port of the server'
)
# sshpassword-path
self.parser.add_argument(
'-k', '--sshkey-path',
type=str,
help='path of the sshkey file, default is'
)
return self.parser