From 73cf294eebec7ee88c3fe93e38d0cf52253eb345 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 16 Feb 2013 19:06:52 +0100 Subject: doc/HACKING: removed reference to ranger/core/environment.py --- doc/HACKING | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/HACKING b/doc/HACKING index 89452398..72dc94bc 100644 --- a/doc/HACKING +++ b/doc/HACKING @@ -29,7 +29,6 @@ Starting Points Good places to read about ranger internals are: ranger/core/actions.py -ranger/core/environment.py ranger/fsobject/fsobject.py About the UI: -- cgit 1.4.1-2-gfad0 From a8593a85bb8939a7dfc92ed39e24b7c9f76004a7 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 16 Feb 2013 19:07:41 +0100 Subject: config/commands.py: removed obsolete reference to fm.env --- ranger/config/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index d64e0773..18b2f395 100644 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1082,7 +1082,7 @@ class narrow(Command): self.fm.thisdir.load_content(schedule=False) def tab(self): - if self.fm.env.cwd.files[-1] is not self.fm.env.cf: + if self.fm.thisdir.files[-1] is not self.fm.thisfile: self.fm.move(down=1) else: # We're at the bottom, so wrap -- cgit 1.4.1-2-gfad0 From 86048e558dc4b12c0b2a461e77f26828aa64e0a8 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 16 Feb 2013 20:06:20 +0100 Subject: config/commands: allow going into hidden directories with :narrow --- ranger/config/commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 18b2f395..9a42f66d 100644 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1067,11 +1067,14 @@ class narrow(Command): """ def execute(self): + results = len(self.fm.thisdir.files) self.cancel() # Clean up if self.rest(1) == "..": self.fm.move(left=1) - else: + elif results > 0: self.fm.move(right=1) + else: + self.fm.cd(self.rest(1)) def cancel(self): self.fm.thisdir.temporary_filter = None -- cgit 1.4.1-2-gfad0 From 096fd48b21ad1c9c5657bbec9d2a26ea55d22c62 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 16 Feb 2013 20:07:12 +0100 Subject: config/commands: cleaner implementation of travel.execute() --- ranger/config/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 9a42f66d..372aeccb 100644 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1115,11 +1115,11 @@ class travel(narrow, Command): """ def execute(self): - thisfile = self.fm.thisfile + thisdir = self.fm.thisdir narrow.execute(self) # reopen the console: - if thisfile and thisfile.is_directory or self.rest(1) == "..": + if thisdir != self.fm.thisdir: self.fm.open_console(self.__class__.__name__ + " ") if self.rest(1) != "..": self.fm.block_input(0.5) -- cgit 1.4.1-2-gfad0 From c6cfbaf2dae5d5aadfabfa82e48a1ca7d3ae0708 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 17 Feb 2013 18:58:55 +0100 Subject: core.loader: Fix passing stdin to commands in python3 --- ranger/core/loader.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ranger/core/loader.py b/ranger/core/loader.py index bae19e9e..d5e5e615 100644 --- a/ranger/core/loader.py +++ b/ranger/core/loader.py @@ -133,6 +133,7 @@ class CommandLoader(Loadable, SignalDispatcher, FileManagerAware): self.kill_on_pause = kill_on_pause def generate(self): + py3 = sys.version >= '3' if self.input: stdin = PIPE else: @@ -141,12 +142,17 @@ class CommandLoader(Loadable, SignalDispatcher, FileManagerAware): stdout=PIPE, stderr=PIPE, stdin=stdin) self.signal_emit('before', process=process, loader=self) if self.input: + if py3: + import io + stdin = io.TextIOWrapper(process.stdin) + else: + stdin = process.stdin try: - process.stdin.write(self.input) + stdin.write(self.input) except IOError as e: if e.errno != errno.EPIPE and e.errno != errno.EINVAL: raise - process.stdin.close() + stdin.close() if self.silent and not self.read: while process.poll() is None: yield @@ -154,7 +160,6 @@ class CommandLoader(Loadable, SignalDispatcher, FileManagerAware): break sleep(0.03) else: - py3 = sys.version >= '3' selectlist = [] if self.read: selectlist.append(process.stdout) -- cgit 1.4.1-2-gfad0 From 93ed704c2ac066772b0da90840d9c57688d88a36 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 17 Feb 2013 20:29:23 +0100 Subject: core.loader: actually kill the process when using kill_on_pause --- ranger/core/loader.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ranger/core/loader.py b/ranger/core/loader.py index d5e5e615..926c11d1 100644 --- a/ranger/core/loader.py +++ b/ranger/core/loader.py @@ -204,6 +204,7 @@ class CommandLoader(Loadable, SignalDispatcher, FileManagerAware): if not self.finished and not self.paused: if self.kill_on_pause: self.finished = True + self.process.kill() return try: self.process.send_signal(20) -- cgit 1.4.1-2-gfad0 From 0955e44aa3d809c75f6247075d32d0e5e368d622 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 17 Feb 2013 22:28:28 +0100 Subject: config/commands: make :travel independent of :narrow --- ranger/config/commands.py | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 372aeccb..90ca3b65 100644 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1105,7 +1105,7 @@ class narrow(Command): return re.compile(regex % ".*".join(arg), flags) -class travel(narrow, Command): +class travel(Command): """ :travel @@ -1116,7 +1116,14 @@ class travel(narrow, Command): def execute(self): thisdir = self.fm.thisdir - narrow.execute(self) + + self.cancel() # Clean up + if self.rest(1) == "..": + self.fm.move(left=1) + elif len(thisdir.files) > 0: + self.fm.move(right=1) + else: + self.fm.cd(self.rest(1)) # reopen the console: if thisdir != self.fm.thisdir: @@ -1124,8 +1131,13 @@ class travel(narrow, Command): if self.rest(1) != "..": self.fm.block_input(0.5) + def cancel(self): + self.fm.thisdir.temporary_filter = None + self.fm.thisdir.load_content(schedule=False) + def quick(self): - narrow.quick(self) + self.fm.thisdir.temporary_filter = self.build_regex(self.rest(1)) + self.fm.thisdir.load_content(schedule=False) arg = self.rest(1) if arg == ".": @@ -1133,6 +1145,26 @@ class travel(narrow, Command): elif arg and len(self.fm.thisdir.files) == 1 or arg == "..": return True + def tab(self): + if self.fm.thisdir.files[-1] is not self.fm.thisfile: + self.fm.move(down=1) + else: + # We're at the bottom, so wrap + self.fm.move(to=0) + + def build_regex(self, arg): + regex = "%s" + if arg.endswith("$"): + arg = arg[:-1] + regex += "$" + if arg.startswith("^"): + arg = arg[1:] + regex = "^" + regex + + case_insensitive = arg.lower() == arg + flags = re.I if case_insensitive else 0 + return re.compile(regex % ".*".join(arg), flags) + class filter(Command): """ -- cgit 1.4.1-2-gfad0 From a4e8f6e5961e043f059ea1eef9962d970d233591 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 17 Feb 2013 22:28:57 +0100 Subject: config/commands: remove :narrow command The command :narrow has few use cases, which will be served by a system that'll be implemented at a later point. --- ranger/config/commands.py | 49 ----------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 90ca3b65..4c3b3bac 100644 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1056,55 +1056,6 @@ class pmap(map_): context = 'pager' -# TODO: Maybe merge this with :find? -class narrow(Command): - """ - :narrow - - Displays only the files which contain in their basename. - Unlike :filter, this command executes the selection and removes the filter - again when run. - """ - - def execute(self): - results = len(self.fm.thisdir.files) - self.cancel() # Clean up - if self.rest(1) == "..": - self.fm.move(left=1) - elif results > 0: - self.fm.move(right=1) - else: - self.fm.cd(self.rest(1)) - - def cancel(self): - self.fm.thisdir.temporary_filter = None - self.fm.thisdir.load_content(schedule=False) - - def quick(self): - self.fm.thisdir.temporary_filter = self.build_regex(self.rest(1)) - self.fm.thisdir.load_content(schedule=False) - - def tab(self): - if self.fm.thisdir.files[-1] is not self.fm.thisfile: - self.fm.move(down=1) - else: - # We're at the bottom, so wrap - self.fm.move(to=0) - - def build_regex(self, arg): - regex = "%s" - if arg.endswith("$"): - arg = arg[:-1] - regex += "$" - if arg.startswith("^"): - arg = arg[1:] - regex = "^" + regex - - case_insensitive = arg.lower() == arg - flags = re.I if case_insensitive else 0 - return re.compile(regex % ".*".join(arg), flags) - - class travel(Command): """ :travel -- cgit 1.4.1-2-gfad0 From 7e21fb55d06fda57db1f300840498a2855477cc5 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 17 Feb 2013 22:34:24 +0100 Subject: core.main: made --fail-unless-cd deprecated Instead of launching ranger for opening files, simply use rifle. --- doc/ranger.1 | 8 ++------ doc/ranger.pod | 7 +------ ranger/core/main.py | 18 +++++++++++------- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 0deac56e..d83ebeca 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.5.5" "01/01/2013" "ranger manual" +.TH RANGER 1 "ranger-1.5.5" "02/17/2013" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -134,7 +134,7 @@ ranger \- visual file manager .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBranger\fR [\fB\-\-help\fR] [\fB\-\-version\fR] [\fB\-\-debug\fR] [\fB\-\-clean\fR] -[\fB\-\-list\-unused\-keys\fR] [\fB\-\-fail\-unless\-cd\fR] [\fB\-\-choosedir\fR=\fItargetfile\fR] +[\fB\-\-list\-unused\-keys\fR] [\fB\-\-choosedir\fR=\fItargetfile\fR] [\fB\-\-choosefile\fR=\fItargetfile\fR] [\fB\-\-copy\-config\fR=\fIfile\fR] [\fB\-\-mode\fR=\fImode\fR] [\fB\-\-flags\fR=\fIflags\fR] [\fIpath/filename\fR] .SH "DESCRIPTION" @@ -195,10 +195,6 @@ use the key code returned by \f(CW\*(C`getch()\*(C'\fR. .IX Item "--list-tagged-files=tag" List all files which are tagged with the given tag. Note: Tags are single characters. The default tag is \*(L"*\*(R" -.IP "\fB\-\-fail\-unless\-cd\fR" 14 -.IX Item "--fail-unless-cd" -Return the exit code 1 if ranger is used to run a file instead of used for file -browsing. (For example, \*(L"ranger \-\-fail\-unless\-cd test.txt\*(R" returns 1.) .IP "\fB\-m\fR \fIn\fR, \fB\-\-mode\fR=\fIn\fR" 14 .IX Item "-m n, --mode=n" When a filename is supplied, run it in mode \fIn\fR. This has no effect unless diff --git a/doc/ranger.pod b/doc/ranger.pod index a06bc6ca..a5b1fed6 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -8,7 +8,7 @@ ranger - visual file manager =head1 SYNOPSIS B [B<--help>] [B<--version>] [B<--debug>] [B<--clean>] -[B<--list-unused-keys>] [B<--fail-unless-cd>] [B<--choosedir>=I] +[B<--list-unused-keys>] [B<--choosedir>=I] [B<--choosefile>=I] [B<--copy-config>=I] [B<--mode>=I] [B<--flags>=I] [I] @@ -88,11 +88,6 @@ use the key code returned by C. List all files which are tagged with the given tag. Note: Tags are single characters. The default tag is "*" -=item B<--fail-unless-cd> - -Return the exit code 1 if ranger is used to run a file instead of used for file -browsing. (For example, "ranger --fail-unless-cd test.txt" returns 1.) - =item B<-m> I, B<--mode>=I When a filename is supplied, run it in mode I. This has no effect unless diff --git a/ranger/core/main.py b/ranger/core/main.py index 579d40eb..a082b8fb 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -40,7 +40,7 @@ def main(): if arg.copy_config is not None: fm = FM() fm.copy_config_files(arg.copy_config) - return 1 if arg.fail_unless_cd else 0 + return 1 if arg.fail_unless_cd else 0 # COMPAT if arg.list_tagged_files: fm = FM() try: @@ -54,7 +54,7 @@ def main(): sys.stdout.write(line[2:]) elif len(line) > 0 and '*' in arg.list_tagged_files: sys.stdout.write(line) - return 1 if arg.fail_unless_cd else 0 + return 1 if arg.fail_unless_cd else 0 # COMPAT SettingsAware._setup(clean=arg.clean) @@ -82,7 +82,7 @@ def main(): rifle = Rifle(rifleconf) rifle.reload_config() rifle.execute(targets, number=ranger.arg.mode, flags=ranger.arg.flags) - return 1 if arg.fail_unless_cd else 0 + return 1 if arg.fail_unless_cd else 0 # COMPAT crash_traceback = None try: @@ -101,7 +101,7 @@ def main(): for key in range(33, 127): if key not in maps: print(chr(key)) - return 1 if arg.fail_unless_cd else 0 + return 1 if arg.fail_unless_cd else 0 # COMPAT if fm.username == 'root': fm.settings.preview_files = False @@ -166,7 +166,7 @@ def main(): def parse_arguments(): """Parse the program arguments""" - from optparse import OptionParser + from optparse import OptionParser, SUPPRESS_HELP from os.path import expanduser from ranger import CONFDIR, USAGE, VERSION from ranger.ext.openstruct import OpenStruct @@ -186,8 +186,7 @@ def parse_arguments(): help="copy the default configs to the local config directory. " "Possible values: all, rc, rifle, commands, scope") parser.add_option('--fail-unless-cd', action='store_true', - help="experimental: return the exit code 1 if ranger is" \ - "used to run a file (with `ranger filename`)") + help=SUPPRESS_HELP) # COMPAT parser.add_option('-r', '--confdir', type='string', metavar='dir', default=default_confdir, help="the configuration directory. (%default)") @@ -224,6 +223,11 @@ def parse_arguments(): arg = OpenStruct(options.__dict__, targets=positional) arg.confdir = expanduser(arg.confdir) + if arg.fail_unless_cd: # COMPAT + sys.stderr.write("Warning: The option --fail-unless-cd is deprecated.\n" + "It was used to faciliate using ranger as a file launcher.\n" + "Now, please use the standalone file launcher 'rifle' instead.\n") + return arg -- cgit 1.4.1-2-gfad0 From 279a30238aa47f2bd37abcb40ecb907004e4bd8c Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 17 Feb 2013 22:52:08 +0100 Subject: core.main: made --mode and --flag deprecated Again, use rifle as a file launcher instead --- doc/ranger.1 | 3 +-- doc/ranger.pod | 14 +------------- ranger/core/main.py | 10 ++++++---- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index d83ebeca..9591b14e 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -135,8 +135,7 @@ ranger \- visual file manager .IX Header "SYNOPSIS" \&\fBranger\fR [\fB\-\-help\fR] [\fB\-\-version\fR] [\fB\-\-debug\fR] [\fB\-\-clean\fR] [\fB\-\-list\-unused\-keys\fR] [\fB\-\-choosedir\fR=\fItargetfile\fR] -[\fB\-\-choosefile\fR=\fItargetfile\fR] [\fB\-\-copy\-config\fR=\fIfile\fR] [\fB\-\-mode\fR=\fImode\fR] -[\fB\-\-flags\fR=\fIflags\fR] [\fIpath/filename\fR] +[\fB\-\-choosefile\fR=\fItargetfile\fR] [\fB\-\-copy\-config\fR=\fIfile\fR] [\fIpath/filename\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" ranger is a console file manager with \s-1VI\s0 key bindings. It provides a diff --git a/doc/ranger.pod b/doc/ranger.pod index a5b1fed6..c7d2360e 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -9,8 +9,7 @@ ranger - visual file manager B [B<--help>] [B<--version>] [B<--debug>] [B<--clean>] [B<--list-unused-keys>] [B<--choosedir>=I] -[B<--choosefile>=I] [B<--copy-config>=I] [B<--mode>=I] -[B<--flags>=I] [I] +[B<--choosefile>=I] [B<--copy-config>=I] [I] @@ -88,17 +87,6 @@ use the key code returned by C. List all files which are tagged with the given tag. Note: Tags are single characters. The default tag is "*" -=item B<-m> I, B<--mode>=I - -When a filename is supplied, run it in mode I. This has no effect unless -the execution of this file type is explicitly handled in the configuration. - -=item B<-f> I, B<--flags>=I - -When a filename is supplied, run it with the given I to modify -behavior. The execution of this file type is explicitly handled in the -configuration. - =item B<--cmd>=I Execute the command after the configuration has been read. Use this option diff --git a/ranger/core/main.py b/ranger/core/main.py index a082b8fb..809c3aae 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -64,13 +64,16 @@ def main(): targets = arg.targets or ['.'] target = targets[0] - if arg.targets: + if arg.targets: # COMPAT if target.startswith('file://'): target = target[7:] if not os.access(target, os.F_OK): print("File or directory doesn't exist: %s" % target) return 1 elif os.path.isfile(target): + sys.stderr.write("Warning: Using ranger as a file launcher is " + "deprecated.\nPlease use the standalone file launcher " + "'rifle' instead.\n") def print_function(string): print(string) from ranger.ext.rifle import Rifle @@ -191,10 +194,9 @@ def parse_arguments(): metavar='dir', default=default_confdir, help="the configuration directory. (%default)") parser.add_option('-m', '--mode', type='int', default=0, metavar='n', - help="if a filename is supplied, run it with this mode") + help=SUPPRESS_HELP) # COMPAT parser.add_option('-f', '--flags', type='string', default='', - metavar='string', - help="if a filename is supplied, run it with these flags.") + metavar='string', help=SUPPRESS_HELP) # COMPAT parser.add_option('--choosefile', type='string', metavar='TARGET', help="Makes ranger act like a file chooser. When opening " "a file, it will quit and write the name of the selected " -- cgit 1.4.1-2-gfad0 From 7873a7cf96be9106836d76227f535f168839ad8b Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 17 Feb 2013 23:54:20 +0100 Subject: config/commands: update docstring of :travel --- ranger/config/commands.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 4c3b3bac..5f6c6b2b 100644 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1060,9 +1060,11 @@ class travel(Command): """ :travel - Displays only the files which contain in their basename. - Unlike :narrow, this leaves open the console so you can travel faster - from directory to directory. + Filters the current directory for files containing the letters in the + string, possibly with other letters in between. The filter is applied as + you type. When only one directory is left, it is entered and the console + is automatially reopened, allowing for fast travel. + To close the console, press ESC or execute a file. """ def execute(self): -- cgit 1.4.1-2-gfad0 From 04ec3e360f54d0cdcadbc40896452cdb266b51de Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 17 Feb 2013 23:54:31 +0100 Subject: doc/ranger.1: added :travel to man page --- doc/ranger.1 | 8 ++++++++ doc/ranger.pod | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/doc/ranger.1 b/doc/ranger.1 index 9591b14e..f8f487ff 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -730,6 +730,7 @@ ranger. For your convenience, this is a list of the \*(L"public\*(R" commands i \& terminal \& tmap key command \& touch filename +\& travel pattern \& tunmap keys... \& unmap keys... \& unmark pattern @@ -930,6 +931,13 @@ Binds keys for the taskview. Works like the \f(CW\*(C`map\*(C'\fR command. .IP "touch \fIfilename\fR" 2 .IX Item "touch filename" Creates an empty file with the name \fIfilename\fR, unless it already exists. +.IP "travel \fIpattern\fR" 2 +.IX Item "travel pattern" +Filters the current directory for files containing the letters in the +string, possibly with other letters in between. The filter is applied as +you type. When only one directory is left, it is entered and the console +is automatially reopened, allowing for fast travel. +To close the console, press \s-1ESC\s0 or execute a file. .IP "tunmap [\fIkeys ...\fR]" 2 .IX Item "tunmap [keys ...]" Removes key mappings of the taskview. Works like the \f(CW\*(C`unmap\*(C'\fR command. diff --git a/doc/ranger.pod b/doc/ranger.pod index c7d2360e..7726d79b 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -727,6 +727,7 @@ ranger. For your convenience, this is a list of the "public" commands including terminal tmap key command touch filename + travel pattern tunmap keys... unmap keys... unmark pattern @@ -966,6 +967,14 @@ Binds keys for the taskview. Works like the C command. Creates an empty file with the name I, unless it already exists. +=item travel I + +Filters the current directory for files containing the letters in the +string, possibly with other letters in between. The filter is applied as +you type. When only one directory is left, it is entered and the console +is automatially reopened, allowing for fast travel. +To close the console, press ESC or execute a file. + =item tunmap [I] Removes key mappings of the taskview. Works like the C command. -- cgit 1.4.1-2-gfad0 From c647bdb3e5e86cf7e658e14e2e29574c09283b03 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 17 Feb 2013 23:55:30 +0100 Subject: doc/ranger.1: fully removed --mode and --flags from man page --- doc/ranger.1 | 9 --------- 1 file changed, 9 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index f8f487ff..81eba150 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -194,15 +194,6 @@ use the key code returned by \f(CW\*(C`getch()\*(C'\fR. .IX Item "--list-tagged-files=tag" List all files which are tagged with the given tag. Note: Tags are single characters. The default tag is \*(L"*\*(R" -.IP "\fB\-m\fR \fIn\fR, \fB\-\-mode\fR=\fIn\fR" 14 -.IX Item "-m n, --mode=n" -When a filename is supplied, run it in mode \fIn\fR. This has no effect unless -the execution of this file type is explicitly handled in the configuration. -.IP "\fB\-f\fR \fIflags\fR, \fB\-\-flags\fR=\fIflags\fR" 14 -.IX Item "-f flags, --flags=flags" -When a filename is supplied, run it with the given \fIflags\fR to modify -behavior. The execution of this file type is explicitly handled in the -configuration. .IP "\fB\-\-cmd\fR=\fIcommand\fR" 14 .IX Item "--cmd=command" Execute the command after the configuration has been read. Use this option -- cgit 1.4.1-2-gfad0 From fae5dba39993fcbf56b7dc6b90403f6328e23035 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 18 Feb 2013 00:02:34 +0100 Subject: doc/ranger.1: update doc of :chmod, :delete, :find, :save_copy_buffer --- doc/ranger.1 | 25 +++++++++++-------------- doc/ranger.pod | 21 +++++++++------------ 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 81eba150..fe6ae684 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.5.5" "02/17/2013" "ranger manual" +.TH RANGER 1 "ranger-1.5.5" "02/18/2013" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -694,7 +694,7 @@ ranger. For your convenience, this is a list of the \*(L"public\*(R" commands i \& copypmap key newkey [newkey2...] \& copytmap key newkey [newkey2...] \& cunmap keys... -\& delete [confirmation] +\& delete \& edit [filename] \& eval [\-q] python_code \& filter [string] @@ -761,9 +761,9 @@ the user, the group and others. A 1 permits execution, a 2 permits writing, a 4 permits reading. Add those numbers to combine them. So a 7 permits everything. .Sp -Key bindings in the form of [\-+] and = also exist. For +Key bindings in the form of [\-+] and = also exist. For example, \fB+ar\fR allows reading for everyone, \-ow forbids others to write and -=777 allows everything. +777= allows everything. .Sp See also: man 1 chmod .IP "cmap \fIkey\fR \fIcommand\fR" 2 @@ -793,14 +793,11 @@ See \f(CW\*(C`copymap\*(C'\fR .IP "cunmap [\fIkeys...\fR]" 2 .IX Item "cunmap [keys...]" Removes key mappings of the console. Works like the \f(CW\*(C`unmap\*(C'\fR command. -.IP "delete [\fIconfirmation\fR]" 2 -.IX Item "delete [confirmation]" +.IP "delete" 2 +.IX Item "delete" Destroy all files in the selection with a roundhouse kick. ranger will ask for a confirmation if you attempt to delete multiple (marked) files or non-empty -directories. -.Sp -When asking for confirmation, this command will only proceed if the last given -word starts with a `y'. +directories. This can be changed by modifying the setting \*(L"confirm_on_delete\*(R". .IP "edit [\fIfilename\fR]" 2 .IX Item "edit [filename]" Edit the current file or the file in the argument. @@ -820,9 +817,9 @@ Displays only the files which contain the \fIstring\fR in their basename. Runni this command without any parameter will reset the fitler. .IP "find \fIpattern\fR" 2 .IX Item "find pattern" -Search files in the current directory that match the given (case-insensitive) -regular expression pattern as you type. Once there is an unambiguous result, -it will be run immediately. (Or entered, if it's a directory.) +Search files in the current directory that contain the given (case-insensitive) +string in their name as you type. Once there is an unambiguous result, it will +be run immediately. (Or entered, if it's a directory.) .IP "grep \fIpattern\fR" 2 .IX Item "grep pattern" Looks for a string in all marked files or directories. @@ -879,7 +876,7 @@ Rename the current file. If a file with that name already exists, the renaming will fail. Also try the key binding A for appending something to a file name. .IP "save_copy_buffer" 2 .IX Item "save_copy_buffer" -Save the copy buffer from \fI~/.config/ranger/copy_buffer\fR. This can be used to +Save the copy buffer to \fI~/.config/ranger/copy_buffer\fR. This can be used to pass the list of copied files to another ranger instance. .IP "search \fIpattern\fR" 2 .IX Item "search pattern" diff --git a/doc/ranger.pod b/doc/ranger.pod index 7726d79b..853776c4 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -700,7 +700,7 @@ ranger. For your convenience, this is a list of the "public" commands including copypmap key newkey [newkey2...] copytmap key newkey [newkey2...] cunmap keys... - delete [confirmation] + delete edit [filename] eval [-q] python_code filter [string] @@ -773,9 +773,9 @@ the user, the group and others. A 1 permits execution, a 2 permits writing, a 4 permits reading. Add those numbers to combine them. So a 7 permits everything. -Key bindings in the form of [-+] and = also exist. For +Key bindings in the form of [-+] and = also exist. For example, B<+ar> allows reading for everyone, -ow forbids others to write and -=777 allows everything. +777= allows everything. See also: man 1 chmod @@ -813,14 +813,11 @@ See C Removes key mappings of the console. Works like the C command. -=item delete [I] +=item delete Destroy all files in the selection with a roundhouse kick. ranger will ask for a confirmation if you attempt to delete multiple (marked) files or non-empty -directories. - -When asking for confirmation, this command will only proceed if the last given -word starts with a `y'. +directories. This can be changed by modifying the setting "confirm_on_delete". =item edit [I] @@ -844,9 +841,9 @@ this command without any parameter will reset the fitler. =item find I -Search files in the current directory that match the given (case-insensitive) -regular expression pattern as you type. Once there is an unambiguous result, -it will be run immediately. (Or entered, if it's a directory.) +Search files in the current directory that contain the given (case-insensitive) +string in their name as you type. Once there is an unambiguous result, it will +be run immediately. (Or entered, if it's a directory.) =item grep I @@ -917,7 +914,7 @@ will fail. Also try the key binding A for appending something to a file name. =item save_copy_buffer -Save the copy buffer from I<~/.config/ranger/copy_buffer>. This can be used to +Save the copy buffer to I<~/.config/ranger/copy_buffer>. This can be used to pass the list of copied files to another ranger instance. =item search I -- cgit 1.4.1-2-gfad0 From e0a24ff235dc024c9b1d57eb648082da4166d9f8 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 18 Feb 2013 00:24:56 +0100 Subject: config/commands: remove "--color=always" from :grep this avoids garbled output for a pager that doesn't pass through ansi codes to the terminal --- ranger/config/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 5f6c6b2b..7c6a7680 100644 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1142,7 +1142,7 @@ class grep(Command): def execute(self): if self.rest(1): - action = ['grep', '--color=always', '--line-number'] + action = ['grep', '--line-number'] action.extend(['-e', self.rest(1), '-r']) action.extend(f.path for f in self.fm.thistab.get_selection()) self.fm.execute_command(action, flags='p') -- cgit 1.4.1-2-gfad0 From ef6fcb2da8aa477289d121b679f08f460951a978 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 18 Feb 2013 00:28:01 +0100 Subject: ranger.1: update doc of :open_with --- doc/ranger.1 | 5 ++--- doc/ranger.pod | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index fe6ae684..9367941c 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -850,9 +850,8 @@ Creates a directory with the name \fIdirname\fR. .IP "open_with [\fIapplication\fR] [\fIflags\fR] [\fImode\fR]" 2 .IX Item "open_with [application] [flags] [mode]" Open the selected files with the given application, unless it is omitted, in -which case the default application is used. \fIflags\fR are characters out of -\&\*(L"sdpcwSDPCW\*(R" and \fImode\fR is any positive integer. Their meanings are discussed -in their own sections. +which case the default application is used. \fIflags\fR and \fImode\fR have their +own section in the man page. .IP "pmap \fIkey\fR \fIcommand\fR" 2 .IX Item "pmap key command" Binds keys for the pager. Works like the \f(CW\*(C`map\*(C'\fR command. diff --git a/doc/ranger.pod b/doc/ranger.pod index 853776c4..ed5618be 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -881,9 +881,8 @@ Creates a directory with the name I. =item open_with [I] [I] [I] Open the selected files with the given application, unless it is omitted, in -which case the default application is used. I are characters out of -"sdpcwSDPCW" and I is any positive integer. Their meanings are discussed -in their own sections. +which case the default application is used. I and I have their +own section in the man page. =item pmap I I -- cgit 1.4.1-2-gfad0 From a385c76ace33210b67de07e23a4a0681e1bdfe9c Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 18 Feb 2013 00:29:27 +0100 Subject: ranger.__init__: change [path/filename] to [path] in USAGE this indicates that ranger should not be used as a file launcher anymore, since it now ships with the standalone program `rifle'. --- doc/ranger.1 | 2 +- doc/ranger.pod | 2 +- ranger/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 9367941c..617ba9f3 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -135,7 +135,7 @@ ranger \- visual file manager .IX Header "SYNOPSIS" \&\fBranger\fR [\fB\-\-help\fR] [\fB\-\-version\fR] [\fB\-\-debug\fR] [\fB\-\-clean\fR] [\fB\-\-list\-unused\-keys\fR] [\fB\-\-choosedir\fR=\fItargetfile\fR] -[\fB\-\-choosefile\fR=\fItargetfile\fR] [\fB\-\-copy\-config\fR=\fIfile\fR] [\fIpath/filename\fR] +[\fB\-\-choosefile\fR=\fItargetfile\fR] [\fB\-\-copy\-config\fR=\fIfile\fR] [\fIpath\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" ranger is a console file manager with \s-1VI\s0 key bindings. It provides a diff --git a/doc/ranger.pod b/doc/ranger.pod index ed5618be..ff920884 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -9,7 +9,7 @@ ranger - visual file manager B [B<--help>] [B<--version>] [B<--debug>] [B<--clean>] [B<--list-unused-keys>] [B<--choosedir>=I] -[B<--choosefile>=I] [B<--copy-config>=I] [I] +[B<--choosefile>=I] [B<--copy-config>=I] [I] diff --git a/ranger/__init__.py b/ranger/__init__.py index 6894258d..2dbffb7e 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -26,7 +26,7 @@ MAX_RESTORABLE_TABS = 3 MACRO_DELIMITER = '%' DEFAULT_PAGER = 'less' LOGFILE = '/tmp/ranger_errorlog' -USAGE = '%prog [options] [path/filename]' +USAGE = '%prog [options] [path]' VERSION = 'ranger-master %s\n\nPython %s' % (__version__, sys.version) # If the environment variable XDG_CONFIG_HOME is non-empty, CONFDIR is ignored -- cgit 1.4.1-2-gfad0 From fb24f4a8ca6475ce2966298a5753ee01d8628e6b Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 18 Feb 2013 00:35:45 +0100 Subject: examples/rifle_sxiv.sh: remove bash dependency --- examples/rifle_sxiv.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rifle_sxiv.sh b/examples/rifle_sxiv.sh index efa935b2..542aa604 100755 --- a/examples/rifle_sxiv.sh +++ b/examples/rifle_sxiv.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # This script searches image files in a directory, opens them all with sxiv # and sets the first argument to the first image displayed by sxiv. -- cgit 1.4.1-2-gfad0 From baf1bafa5c90b856c690b33ff74bc0fec344ae1c Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 18 Feb 2013 00:41:36 +0100 Subject: examples/rifle_sxiv.sh: removed realpath dependency --- examples/rifle_sxiv.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/rifle_sxiv.sh b/examples/rifle_sxiv.sh index 542aa604..0cbda01e 100755 --- a/examples/rifle_sxiv.sh +++ b/examples/rifle_sxiv.sh @@ -11,12 +11,19 @@ # [ "$1" == '--' ] && shift -target="$(realpath -s "$1")" + +function abspath { + case "$1" in + /*) printf "%s\n" "$1";; + *) printf "%s\n" "$PWD/$1";; + esac +} function listfiles { find -L "$(dirname "$target")" -maxdepth 1 -type f -iregex \ '.*\(jpe?g\|bmp\|png\|gif\)$' -print0 | sort -z } +target="$(abspath $1)" count="$(listfiles | grep -m 1 -Zznx "$target" | cut -d: -f1)" if [ -n "$count" ]; then -- cgit 1.4.1-2-gfad0 From de9e10c902596e5879c0622a276665eb5b28d7a9 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 18 Feb 2013 00:48:34 +0100 Subject: api.commands: make DELETE_WARNING deprecated --- ranger/api/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/api/commands.py b/ranger/api/commands.py index ce381e18..010ea37b 100644 --- a/ranger/api/commands.py +++ b/ranger/api/commands.py @@ -12,7 +12,7 @@ from ranger.core.shared import FileManagerAware from ranger.ext.lazy_property import lazy_property SETTINGS_RE = re.compile(r'^\s*([^\s]+?)=(.*)$') -DELETE_WARNING = 'delete seriously? ' +DELETE_WARNING = 'delete seriously? ' # COMPAT def alias(*_): pass # COMPAT -- cgit 1.4.1-2-gfad0 From bfafcaacd6329deddd2a671cc177105699302da3 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 18 Feb 2013 01:00:28 +0100 Subject: ranger.1: added missing docs of settings --- doc/ranger.1 | 9 ++++++++- doc/ranger.pod | 11 ++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 617ba9f3..92d8a7f6 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -614,6 +614,9 @@ Preview directories in the preview column? .IP "preview_files [bool] " 4 .IX Item "preview_files [bool] " Preview files in the preview column? +.IP "preview_images [bool]" 4 +.IX Item "preview_images [bool]" +Draw images inside the console with the external program w3mimgpreview? .IP "preview_script [string, none]" 4 .IX Item "preview_script [string, none]" Which script should handle generating previews? If the file doesn't exist, or @@ -654,7 +657,11 @@ Reverse the order of files? Which sorting mechanism should be used? Choose one of \fBatime\fR, \fBbasename\fR, \&\fBctime\fR, \fBmtime\fR, \fBnatural\fR, \fBtype\fR, \fBsize\fR .Sp -Note: You can reverse the order by using an uppercase O in the key combination. +Note: You can reverse the order by typing an uppercase second letter in the key +combination, e.g. \*(L"oN\*(R" to sort from Z to A. +.IP "status_bar_on_top [bool]" 4 +.IX Item "status_bar_on_top [bool]" +Put the status bar at the top of the window? .IP "tilde_in_titlebar [bool]" 4 .IX Item "tilde_in_titlebar [bool]" Abbreviate \f(CW$HOME\fR with ~ in the title bar (first line) of ranger? diff --git a/doc/ranger.pod b/doc/ranger.pod index ff920884..0d8ef01e 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -601,6 +601,10 @@ Preview directories in the preview column? Preview files in the preview column? +=item preview_images [bool] + +Draw images inside the console with the external program w3mimgpreview? + =item preview_script [string, none] Which script should handle generating previews? If the file doesn't exist, or @@ -651,7 +655,12 @@ Reverse the order of files? Which sorting mechanism should be used? Choose one of B, B, B, B, B, B, B -Note: You can reverse the order by using an uppercase O in the key combination. +Note: You can reverse the order by typing an uppercase second letter in the key +combination, e.g. "oN" to sort from Z to A. + +=item status_bar_on_top [bool] + +Put the status bar at the top of the window? =item tilde_in_titlebar [bool] -- cgit 1.4.1-2-gfad0 From e5238c692c74c9ee361c91f1e7cf2bdecf7418a0 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 18 Feb 2013 01:14:36 +0100 Subject: ranger.1: update list of ranger options --- doc/ranger.1 | 25 +++++++++++++++++-------- doc/ranger.pod | 29 ++++++++++++++++++++--------- ranger/core/main.py | 10 +++++----- 3 files changed, 42 insertions(+), 22 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 92d8a7f6..124e0418 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -133,9 +133,12 @@ ranger \- visual file manager .SH "SYNOPSIS" .IX Header "SYNOPSIS" -\&\fBranger\fR [\fB\-\-help\fR] [\fB\-\-version\fR] [\fB\-\-debug\fR] [\fB\-\-clean\fR] -[\fB\-\-list\-unused\-keys\fR] [\fB\-\-choosedir\fR=\fItargetfile\fR] -[\fB\-\-choosefile\fR=\fItargetfile\fR] [\fB\-\-copy\-config\fR=\fIfile\fR] [\fIpath\fR] +\&\fBranger\fR [\fB\-\-version\fR] [\fB\-\-help\fR] [\fB\-\-debug\fR] [\fB\-\-clean\fR] +[\fB\-\-confdir\fR=\fIdirectory\fR] [\fB\-\-copy\-config\fR=\fIwhich\fR] +[\fB\-\-choosefile\fR=\fItarget\fR] [\fB\-\-choosefiles\fR=\fItarget\fR] +[\fB\-\-choosedir\fR=\fItarget\fR] [\fB\-\-selectfile\fR=\fIfilepath\fR] +[\fB\-\-list\-unused\-keys\fR] [\fB\-\-list\-tagged\-files\fR=\fItag\fR] +[\fB\-\-profile\fR] [\fB\-\-cmd\fR=\fIcommand\fR] [\fIpath\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" ranger is a console file manager with \s-1VI\s0 key bindings. It provides a @@ -163,6 +166,14 @@ exception in the statusbar/log and try to keep running. 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. +.IP "\fB\-r\fR \fIdir\fR, \fB\-\-confdir\fR=\fIdir\fR" 14 +.IX Item "-r dir, --confdir=dir" +Change the configuration directory of ranger from ~/.config/ranger to \*(L"dir\*(R". +.IP "\fB\-\-copy\-config\fR=\fIfile\fR" 14 +.IX Item "--copy-config=file" +Create copies of the default configuration files in your local configuration +directory. Existing ones will not be overwritten. Possible values: \fIall\fR, +\&\fIrc\fR, \fIcommands\fR, \fIscope\fR. .IP "\fB\-\-choosefile\fR=\fItargetfile\fR" 14 .IX Item "--choosefile=targetfile" Allows you to pick a file with ranger. This changes the behavior so that when @@ -180,11 +191,6 @@ write the last visited directory into \fItargetfile\fR. .IP "\fB\-\-selectfile\fR=\fItargetfile\fR" 14 .IX Item "--selectfile=targetfile" Open ranger with \fItargetfile\fR selected. -.IP "\fB\-\-copy\-config\fR=\fIfile\fR" 14 -.IX Item "--copy-config=file" -Create copies of the default configuration files in your local configuration -directory. Existing ones will not be overwritten. Possible values: \fIall\fR, -\&\fIrc\fR, \fIcommands\fR, \fIscope\fR. .IP "\fB\-\-list\-unused\-keys\fR" 14 .IX Item "--list-unused-keys" List common keys which are not bound to any action in the \*(L"browser\*(R" context. @@ -194,6 +200,9 @@ use the key code returned by \f(CW\*(C`getch()\*(C'\fR. .IX Item "--list-tagged-files=tag" List all files which are tagged with the given tag. Note: Tags are single characters. The default tag is \*(L"*\*(R" +.IP "\fB\-\-profile\fR" 14 +.IX Item "--profile" +Print statistics of \s-1CPU\s0 usage on exit. .IP "\fB\-\-cmd\fR=\fIcommand\fR" 14 .IX Item "--cmd=command" Execute the command after the configuration has been read. Use this option diff --git a/doc/ranger.pod b/doc/ranger.pod index 0d8ef01e..c4e5c92c 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -7,9 +7,12 @@ ranger - visual file manager =head1 SYNOPSIS -B [B<--help>] [B<--version>] [B<--debug>] [B<--clean>] -[B<--list-unused-keys>] [B<--choosedir>=I] -[B<--choosefile>=I] [B<--copy-config>=I] [I] +B [B<--version>] [B<--help>] [B<--debug>] [B<--clean>] +[B<--confdir>=I] [B<--copy-config>=I] +[B<--choosefile>=I] [B<--choosefiles>=I] +[B<--choosedir>=I] [B<--selectfile>=I] +[B<--list-unused-keys>] [B<--list-tagged-files>=I] +[B<--profile>] [B<--cmd>=I] [I] @@ -49,6 +52,16 @@ 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. +=item B<-r> I, B<--confdir>=I + +Change the configuration directory of ranger from ~/.config/ranger to "dir". + +=item B<--copy-config>=I + +Create copies of the default configuration files in your local configuration +directory. Existing ones will not be overwritten. Possible values: I, +I, I, I. + =item B<--choosefile>=I Allows you to pick a file with ranger. This changes the behavior so that when @@ -70,12 +83,6 @@ write the last visited directory into I. Open ranger with I selected. -=item B<--copy-config>=I - -Create copies of the default configuration files in your local configuration -directory. Existing ones will not be overwritten. Possible values: I, -I, I, I. - =item B<--list-unused-keys> List common keys which are not bound to any action in the "browser" context. @@ -87,6 +94,10 @@ use the key code returned by C. List all files which are tagged with the given tag. Note: Tags are single characters. The default tag is "*" +=item B<--profile> + +Print statistics of CPU usage on exit. + =item B<--cmd>=I Execute the command after the configuration has been read. Use this option diff --git a/ranger/core/main.py b/ranger/core/main.py index 809c3aae..bdebbccc 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -185,14 +185,14 @@ def parse_arguments(): help="activate debug mode") parser.add_option('-c', '--clean', action='store_true', help="don't touch/require any config files. ") + parser.add_option('-r', '--confdir', type='string', + metavar='dir', default=default_confdir, + help="change the configuration directory. (%default)") parser.add_option('--copy-config', type='string', metavar='which', help="copy the default configs to the local config directory. " "Possible values: all, rc, rifle, commands, scope") parser.add_option('--fail-unless-cd', action='store_true', help=SUPPRESS_HELP) # COMPAT - parser.add_option('-r', '--confdir', type='string', - metavar='dir', default=default_confdir, - help="the configuration directory. (%default)") parser.add_option('-m', '--mode', type='int', default=0, metavar='n', help=SUPPRESS_HELP) # COMPAT parser.add_option('-f', '--flags', type='string', default='', @@ -208,10 +208,10 @@ def parse_arguments(): parser.add_option('--choosedir', type='string', metavar='TARGET', help="Makes ranger act like a directory chooser. When ranger quits" ", it will write the name of the last visited directory to TARGET") - parser.add_option('--list-unused-keys', action='store_true', - help="List common keys which are not bound to any action.") parser.add_option('--selectfile', type='string', metavar='filepath', help="Open ranger with supplied file selected.") + parser.add_option('--list-unused-keys', action='store_true', + help="List common keys which are not bound to any action.") parser.add_option('--list-tagged-files', type='string', default=None, metavar='tag', help="List all files which are tagged with the given tag, default: *") -- cgit 1.4.1-2-gfad0 From 2b3110fcfe4ecfeec120c700eb7b7ddb85c4fc40 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 18 Feb 2013 01:18:14 +0100 Subject: README: removed bash dependency --- README | 1 - doc/ranger.1 | 2 +- doc/ranger.pod | 2 +- ranger/config/rifle.conf | 2 +- ranger/core/main.py | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README b/README index 52a0b66c..f5057a01 100644 --- a/README +++ b/README @@ -60,7 +60,6 @@ Optional: * w3m for the "w3mimgdisplay" program to preview images Optional, for enhanced file previews (with "scope.sh"): -* bash for running scope.sh * img2txt (from caca-utils) for previewing images * highlight for syntax highlighting of code * atool for previews of archives diff --git a/doc/ranger.1 b/doc/ranger.1 index 124e0418..453f9d29 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1031,7 +1031,7 @@ program out of \*(L"vim\*(R", \*(L"emacs\*(R" and \*(L"nano\*(R". .IP "\s-1SHELL\s0" 8 .IX Item "SHELL" Defines the shell that ranger is going to use with the :shell command and -the \*(L"S\*(R" key. Defaults to \*(L"bash\*(R". +the \*(L"S\*(R" key. Defaults to \*(L"/bin/sh\*(R". .IP "\s-1TERMCMD\s0" 8 .IX Item "TERMCMD" Defines the terminal emulator command that ranger is going to use with the diff --git a/doc/ranger.pod b/doc/ranger.pod index c4e5c92c..1e3a7242 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -1117,7 +1117,7 @@ program out of "vim", "emacs" and "nano". =item SHELL Defines the shell that ranger is going to use with the :shell command and -the "S" key. Defaults to "bash". +the "S" key. Defaults to "/bin/sh". =item TERMCMD diff --git a/ranger/config/rifle.conf b/ranger/config/rifle.conf index 842c85e2..cc369cda 100644 --- a/ranger/config/rifle.conf +++ b/ranger/config/rifle.conf @@ -96,7 +96,7 @@ name ^[mM]akefile$ = make ext py = python -- "$1" ext pl = perl -- "$1" ext rb = ruby -- "$1" -ext sh = bash -- "$1" +ext sh = sh -- "$1" ext php = php -- "$1" #-------------------------------------------- diff --git a/ranger/core/main.py b/ranger/core/main.py index bdebbccc..16096deb 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -34,7 +34,7 @@ def main(): os.environ[level] = '1' if not 'SHELL' in os.environ: - os.environ['SHELL'] = 'bash' + os.environ['SHELL'] = 'sh' ranger.arg = arg = parse_arguments() if arg.copy_config is not None: -- cgit 1.4.1-2-gfad0