summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/help/__init__.py3
-rw-r--r--ranger/help/index.py1
-rw-r--r--ranger/help/invocation.py106
3 files changed, 109 insertions, 1 deletions
diff --git a/ranger/help/__init__.py b/ranger/help/__init__.py
index 1a651d56..f304c7bc 100644
--- a/ranger/help/__init__.py
+++ b/ranger/help/__init__.py
@@ -24,7 +24,8 @@ NO_HELP = """No help was found.
 Possibly the program was invoked with "python -OO" which
 discards all documentation."""
 
-HELP_TOPICS = ('index', 'movement', 'starting', 'console', 'fileop')
+HELP_TOPICS = ('index', 'movement', 'starting', 'console', 'fileop',
+		'invocation')
 
 def get_docstring_of_module(path, module_name):
 	imported = __import__(path, fromlist=[module_name])
diff --git a/ranger/help/index.py b/ranger/help/index.py
index 794e3ea9..316e975f 100644
--- a/ranger/help/index.py
+++ b/ranger/help/index.py
@@ -26,6 +26,7 @@
 	|2?|	Running Files
 	|3?|	The console
 	|4?|	File operations
+	|5?|	Ranger invocation
 
 
 ==============================================================================
diff --git a/ranger/help/invocation.py b/ranger/help/invocation.py
new file mode 100644
index 00000000..3de574cc
--- /dev/null
+++ b/ranger/help/invocation.py
@@ -0,0 +1,106 @@
+# Copyright (C) 2009, 2010  Roman Zimbelmann <romanz@lavabit.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+"""
+5. Ranger invocation
+
+5.1. Command Line Arguments
+5.2. Python Options
+
+
+==============================================================================
+5.1. Command Line Arguments
+
+These options can be passed to ranger when starting it from the
+command line.
+
+--version
+      Print the version and exit.
+
+-h, --help
+      Print a list of options and exit.
+
+-d, --debug
+      Activate the debug mode:  Whenever an error occurs, ranger
+      will exit and print a full backtrace.  The default behaviour
+      is to merely print the name of the exception in the statusbar/log
+      and to try to keep running.
+
+-c, --clean
+      Activate the clean mode:  Ranger will not access or create any
+      configuration files nor will it leave any traces on your system.
+      This is useful when your configuration is broken, when you want
+      to avoid clutter, etc.
+
+--fail-if-run
+      Return the exit code 1 if ranger is used to run a file, for example
+      with `ranger --fail-if-run filename`.  This can be useful for scripts.
+
+-r <dir>, --confdir=<dir>
+      Define a different configuration directory.  The default is
+      $HOME/.ranger.
+
+-m <n>, --mode=<n>
+      When a filename is supplied, make it run in mode <n> |2|
+
+-f <flags>, --flags=<flags>
+      When a filename is supplied, run it with the flags <flags> |2|
+
+(Optional) Positional Argument
+      The positional argument should be a path to the directory you
+      want ranger to start in, or the file which you want to run.
+      Only one positional argument is accepted as of now.
+
+--
+      Stop looking for options.  All following arguments are treated as
+      positional arguments.
+
+Examples:
+      ranger episode1.avi
+      ranger --debug /usr/bin
+      ranger --confdir=~/.config/ranger --fail-if-run
+
+
+==============================================================================
+5.2. Python Options
+
+Ranger makes use of python optimize flags.  To use them, run ranger like this:
+      PYTHONOPTIMIZE=1 ranger
+An alternative is:
+      python -O `which ranger`
+Or you could change the first line of the ranger script and add -O/-OO.
+The first way is the recommended one.  Of course you can make an alias or
+a shell fuction to save typing.
+
+Using PYTHONOPTIMIZE=1 (-O) will make python discard assertion statements.
+Assertions are little pieces of code which are helpful for finding errors,
+but unless you're touching sensitive parts of ranger, you may want to
+disable them to save some computing power.
+
+Using PYTHONOPTIMIZE=2 (-OO) will additionally discard any docstrings.
+In ranger, most built-in documentation (F1/? keys) is implemented with
+docstrings.  Use this option if you don't need the documentation.
+
+Examples:
+      PYTHONOPTIMIZE=1 ranger episode1.avi
+      PYTHONOPTIMIZE=2 ranger --debug /usr/bin
+      python -OO `which ranger` --confdir=~/.config/ranger --fail-if-run
+
+Note: The author expected "-OO" to reduce the memory usage, but that
+doesn't seem to happen.
+
+
+==============================================================================
+"""
+# vim:tw=78:sw=8:sts=8:ts=8:ft=help