about summary refs log tree commit diff stats
path: root/src/tools/parser.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix /correct quotation marks usageMichael Vetter2020-07-231-0/+1
| | | | | | | Add new `parse_args_as_one()` function to just use everything after the command as the argument. Fix https://github.com/profanity-im/profanity/issues/1404
* Apply coding styleMichael Vetter2020-07-071-6/+6
|
* Revert "Apply coding style"Michael Vetter2020-07-071-6/+6
| | | | | | This reverts commit 9b55f2dec0ea27a9ce4856e303425e12f866cea2. Sorting the includes creates some problems.
* Apply coding styleMichael Vetter2020-07-071-6/+6
| | | | Regards https://github.com/profanity-im/profanity/issues/1396
* Add vim modelineMichael Vetter2019-11-131-0/+1
|
* Update copyright to include 2019Michael Vetter2019-01-221-1/+1
|
* Update copyrightJames Booth2018-01-211-1/+1
|
* Update CopyrightJames Booth2017-01-281-1/+1
|
* Make header defines consistentJames Booth2016-07-241-2/+2
|
* Update GPL link in headersJames Booth2016-07-241-1/+1
|
* Updated copyrightJames Booth2016-02-141-1/+1
|
* Applied coding style to src/tools/James Booth2015-10-251-5/+5
|
* Updated copyrightJames Booth2015-02-101-1/+1
|
* Simplified autocompleters and command historyJames Booth2015-01-161-2/+2
|
* Added license exemption for OpenSSL to source headersJames Booth2014-08-241-0/+12
|
* Simplified parse_options to take first option as argumentJames Booth2014-04-151-1/+1
|
* Simplified parse_options to take gchar**James Booth2014-04-151-1/+1
|
* Added parse_optionsJames Booth2014-04-141-1/+3
|
* Command argument parsers set result argumentJames Booth2014-04-091-2/+2
|
* Updated copyrightJames Booth2014-03-091-1/+1
|
* Moved functions to parser.c, moved parser to toolsJames Booth2013-07-111-0/+33
db7388eb008896db88d3'>8c4f4189 ^
7bf5f967 ^
e8b8190d ^
7bf5f967 ^




0d1b5bac ^









8a13baa3 ^



0d1b5bac ^








7bf5f967 ^
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
                                                                       
                                                                        
 
   
                                            
 


                                                                         
   
 
          
         
 
             
                    
                     
                                                
                                
 
           
                                     

                                       
                       
                     
                      
                                
                                         
                                                                      




                                                                              









                                                                        



                                                                              








                                                                  
                                 
# Copyright (C) 2009, 2010, 2011  Roman Zimbelmann <romanz@lavabit.com>
# This software is distributed under the terms of the GNU GPL version 3.

"""
A console file manager with VI key bindings.

It provides a minimalistic and nice curses interface with a view on the
directory hierarchy.  The secondary task of ranger is to figure out which
program you want to use to open your files with.
"""

import sys
import os

# Information
__license__ = 'GPL3'
__version__ = '1.5.5'
__author__ = __maintainer__ = 'Roman Zimbelmann'
__email__ = 'romanz@lavabit.com'

# Constants
RANGERDIR = os.path.dirname(__file__)
TICKS_BEFORE_COLLECTING_GARBAGE = 100
TIME_BEFORE_FILE_BECOMES_GARBAGE = 1200
MAX_RESTORABLE_TABS = 3
MACRO_DELIMITER = '%'
DEFAULT_PAGER = 'less'
LOGFILE = '/tmp/ranger_errorlog'
USAGE = '%prog [options] [path/filename]'
VERSION = 'ranger-master %s\n\nPython %s' % (__version__, sys.version)

# If the environment variable XDG_CONFIG_HOME is non-empty, CONFDIR is ignored
# and the configuration directory will be $XDG_CONFIG_HOME/ranger instead.
CONFDIR = '~/.config/ranger'

# Debugging functions.  These will be activated when run with --debug.
# Example usage in the code:
# import ranger; ranger.log("hello world")
def log(*objects, **keywords):
	"""
	Writes objects to a logfile (for the purpose of debugging only.)
	Has the same arguments as print() in python3.
	"""
	from ranger import arg
	if LOGFILE is None or not arg.debug or arg.clean: return
	start = keywords.get('start', 'ranger:')
	sep   = keywords.get('sep', ' ')
	end   = keywords.get('end', '\n')
	_file = keywords['file'] if 'file' in keywords else open(LOGFILE, 'a')
	_file.write(sep.join(map(str, (start, ) + objects)) + end)


def log_traceback():
	from ranger import arg
	if LOGFILE is None or not arg.debug or arg.clean: return
	import traceback
	traceback.print_stack(file=open(LOGFILE, 'a'))

from ranger.core.main import main