Skip to content

Commit 9863dc7

Browse files
committed
add entry
1 parent 92657a0 commit 9863dc7

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

scripts/main.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
import os
5+
import argparse
6+
from datetime import datetime
7+
8+
from util import par_dir, mkdir_p
9+
10+
BASEDIR = os.path.abspath(os.path.dirname(__file__))
11+
12+
13+
def curr_time():
14+
return datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
15+
16+
17+
if __name__ == '__main__':
18+
parser = argparse.ArgumentParser(description='Helper for GitBook algorithm')
19+
parser.add_argument('--new', type=str, dest='new',
20+
help='create new post with given leetcode/lintcode url.')
21+
parser.add_argument('--update', nargs='*', dest='update',
22+
help='update post with given title in post and summary.')
23+
parser.add_argument('--migrate', type=str, dest='migrate',
24+
help='migrate old posts.')
25+
parser.add_argument('--fix-summary', dest='fix_summary',
26+
help='render new summary from posts.')
27+
args = parser.parse_args()
28+
print('Called with arguments: {}'.format(args))
29+
30+
ROOTDIR = par_dir(BASEDIR)

0 commit comments

Comments
 (0)