remove crc table from master branch
[findit] / src / optparser.py
1 #!/usr/bin/env python
2 # -*-coding: utf-8 -*-
3 # vim: sw=4 ts=4 expandtab ai
4 # pylint: disable-msg=C0301
5
6 import os
7 from optparse import OptionParser
8
9 class OptParser(object):
10
11     def __init__(self):
12         parser = OptionParser(usage="Usage: %prog -d -c", version="%prog 0.1.0")
13         # Парсим параметры ком строки
14         parser.add_option('--dir', '-d', dest='dir', type="string", \
15                 help="starting path for search" )
16         parser.add_option('--count', '-c', metavar='COUNT',dest='cnt', type="int", \
17                help="count of files for print")
18         parser.add_option('--config', '-C', metavar='CONFIG',dest='cfg', type="string", \
19                help="config file")
20         (self.options, self.args) = parser.parse_args()
21
22     # функция получения параметров из ком строки
23     def get(self):
24         return self.options
25         
26     def get_st_par(self):
27         return self.options.dir, self.options.cnt