very big Bad commit :) - adding old created files
[findit] / src / optparser.py
old mode 100644 (file)
new mode 100755 (executable)
index bfa0047..293a3b8
@@ -7,17 +7,21 @@ import os
 from optparse import OptionParser
 
 class OptParser(object):
+
     def __init__(self):
-        self.get()   
-    
-    # функция получения параметров из ком строки
-    def get(self):
         parser = OptionParser(usage="Usage: %prog -d -c", version="%prog 0.1.0")
         # Парсим параметры ком строки
         parser.add_option('--dir', '-d', dest='dir', type="string", \
                 help="starting path for search" )
         parser.add_option('--count', '-c', metavar='COUNT',dest='cnt', type="int", \
                help="count of files for print")
+        parser.add_option('--config', '-C', metavar='CONFIG',dest='cfg', type="string", \
+               help="config file")
         (self.options, self.args) = parser.parse_args()
-        return self.options.dir, self.options.cnt
+
+    # функция получения параметров из ком строки
+    def get(self):
+        return self.options
+        
+    def get_st_par(self):
+        return self.options.dir, self.options.cnt
\ No newline at end of file