Anonymous avatar Anonymous committed 998630b

remove analize feature; add default 320 chars output limit; add option for setup the output limit

Comments (0)

Files changed (3)

                                             'core\.\d+$', '\.pyc$')]
 BACKUP_RE = re.compile('\.\d\d\d~$')
 # Thank's to ack for this list
 def TYPES():
         self.stat = {'all': 0}
         self.types_cache = None
         self.filenames = False
+        self.output_limit = DEFAULT_OUTPUT_LIMIT
 def build_lang_options(parser):
                       default=False, help='verbose output')
     parser.add_option('-n', '--filenames', action='store_true',
                       default=False, help='show only file names (only for search)')
+    parser.add_option('--output-limit', type='int',
+                      help='the maximem length of output line before it will be truncated')
         print 'allow exts:', config.allow_exts
         print 'disallow exts:', config.disallow_exts
+    if not opts.output_limit is None:
+        config.output_limit = opts.output_limit
     if not
         if opts.replace:
             parser.error('Replace option could be specified only with search option')
     Search pattern in each line of file.
-    LIMIT = get_terminal_width()
     started = False
     for count, line in enumerate(file(path)):
                 if config.filenames:
                 started = True
-            if len(line) <= LIMIT:
+            if len(line) <= config.output_limit:
                 print '%d:%s' % (number, config.term.highlight(line.rstrip('\n\r'), ('BLACK', 'BG_YELLOW'),
-                print '%d:LINE IS TOO LONG (>%d)' % (number, LIMIT)
+                print '%d:LINE IS TOO LONG (>%d)' % (number, config.output_limit)
     if started:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.