-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
36 lines (27 loc) · 1.09 KB
/
main.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
#!/usr/bin/env python
# coding=utf-8
# Stan 2013-09-15
from __future__ import (division, absolute_import,
print_function, unicode_literals)
import sys
import argparse
import logging
from index.main import main
from index.core.argparse_funcs import readable_file_or_dir_list, readable_file
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
parser = argparse.ArgumentParser(description="Indexing files and directories.")
parser.add_argument('files', action=readable_file_or_dir_list, nargs='*',
help="files and directories to proceed")
parser.add_argument('-p', '--profile',
help='specify the profile')
parser.add_argument('-c', '--config', action=readable_file,
help='specify the config file')
if sys.version_info >= (3,):
argv = sys.argv
else:
fse = sys.getfilesystemencoding()
argv = [i.decode(fse) for i in sys.argv]
args = parser.parse_args(argv[1:])
options = {} # !!!
sys.exit(main(args.files, args.profile, options))