-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelp
executable file
·57 lines (50 loc) · 1.43 KB
/
help
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
#!/usr/bin/env python3
import argparse
from pygitsh import *
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description='show help information',
)
parser.add_argument('-l', '--list-all', action='store_true', help='show as a list')
args = parser.parse_args()
commands = [
{
'name': 'create',
'description': 'create a new repository',
},
{
'name': 'alter',
'description': 'alter attributes of a repository',
},
{
'name': 'list',
'description': 'list repositorys',
},
{
'name': 'remove',
'description': 'remove a repository',
},
{
'name': 'backup',
'description': 'backup a repository',
},
{
'name': 'restore',
'description': 'restore repository from backup',
},
{
'name': 'purge',
'description': 'delete backups',
},
{
'name': 'help',
'description': 'show help information',
},
]
print('All commands supported:\n')
for item in commands:
if args.list_all:
print('%(name)-10s%(description)s' % item)
else:
print("%(name)s " % item, end='')
print('\n\nrun a command with "-h" or "--help" option to learn the usage')