diff options
-rw-r--r-- | doc/ranger.1 | 8 | ||||
-rw-r--r-- | doc/ranger.pod | 7 | ||||
-rw-r--r-- | 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<ranger> [B<--help>] [B<--version>] [B<--debug>] [B<--clean>] -[B<--list-unused-keys>] [B<--fail-unless-cd>] [B<--choosedir>=I<targetfile>] +[B<--list-unused-keys>] [B<--choosedir>=I<targetfile>] [B<--choosefile>=I<targetfile>] [B<--copy-config>=I<file>] [B<--mode>=I<mode>] [B<--flags>=I<flags>] [I<path/filename>] @@ -88,11 +88,6 @@ use the key code returned by C<getch()>. 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<n>, B<--mode>=I<n> When a filename is supplied, run it in mode I<n>. 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 |