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