-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
52 lines (35 loc) · 819 Bytes
/
main.py
File metadata and controls
52 lines (35 loc) · 819 Bytes
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
import click
from wit import Wit
@click.group()
def cli():
pass
@click.command()
def init_cmd():
wit.init()
@click.command()
@click.argument('file_name')
def add_cmd(file_name):
wit.add(file_name)
@click.command()
def log_cmd():
wit.log()
@click.command()
def status_cmd():
wit.status()
@click.command()
@click.argument('commit_id')
def checkout_cmd(commit_id):
wit.checkout(commit_id)
@click.command()
@click.argument('message')
def commit_cmd(message):
wit.commit(message)
cli.add_command(init_cmd, name='init')
cli.add_command(add_cmd, name='add')
cli.add_command(log_cmd, name='log')
cli.add_command(status_cmd, name='status')
cli.add_command(checkout_cmd, name='checkout')
cli.add_command(commit_cmd, name='commit')
if __name__ == '__main__':
wit = Wit()
cli()