From 3c430ba0f1b3fe2e17225788866f37bcd1f85c3b Mon Sep 17 00:00:00 2001 From: toonn Date: Tue, 3 Apr 2018 14:10:35 +0200 Subject: Document change in :cd behavior Added a sentence about the file selecting behavior of `:cd` to the docstring and the manpage. Added missing `=back` to POSITIONAL ARGUMENTS section in the manpage. --- doc/ranger.1 | 12 ++++++------ doc/ranger.pod | 10 ++++++---- ranger/config/commands.py | 3 ++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index 7f307490..bd6116d1 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.1" "2018-03-31" "ranger manual" +.TH RANGER 1 "ranger-1.9.1" "2018-04-03" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -996,7 +996,7 @@ ranger. For your convenience, this is a list of the \*(L"public\*(R" commands i .Vb 10 \& alias [newcommand] [oldcommand] \& bulkrename -\& cd [directory] +\& cd [path] \& chain command1[; command2[; command3...]] \& chmod octal_number \& cmap key command @@ -1072,10 +1072,10 @@ renaming according to the changes you did in the file. .Sp This shell script is opened in an editor for you to review. After you close it, it will be executed. -.IP "cd [\fIdirectory\fR]" 2 -.IX Item "cd [directory]" -The cd command changes the directory. The command \f(CW\*(C`:cd \-\*(C'\fR is equivalent to -typing ``. +.IP "cd [\fIpath\fR]" 2 +.IX Item "cd [path]" +The cd command changes the directory. If path is a file, selects that file. +The command \f(CW\*(C`:cd \-\*(C'\fR is equivalent to typing ``. .IP "chain \fIcommand1\fR[; \fIcommand2\fR[; \fIcommand3\fR...]]" 2 .IX Item "chain command1[; command2[; command3...]]" Combines multiple commands into one, separated by semicolons. diff --git a/doc/ranger.pod b/doc/ranger.pod index 470eaa7e..4b0e90b1 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -62,6 +62,8 @@ The section I of this man page contains further resources. Each path will be opened in a tab and if the path is a file it will be selected. Omitting this is equivalent to providing the current directory. +=back + @@ -1033,7 +1035,7 @@ ranger. For your convenience, this is a list of the "public" commands including alias [newcommand] [oldcommand] bulkrename - cd [directory] + cd [path] chain command1[; command2[; command3...]] chmod octal_number cmap key command @@ -1113,10 +1115,10 @@ renaming according to the changes you did in the file. This shell script is opened in an editor for you to review. After you close it, it will be executed. -=item cd [I] +=item cd [I] -The cd command changes the directory. The command C<:cd -> is equivalent to -typing ``. +The cd command changes the directory. If path is a file, selects that file. +The command C<:cd -> is equivalent to typing ``. =item chain I[; I[; I...]] diff --git a/ranger/config/commands.py b/ranger/config/commands.py index a3837d8e..2f1480b9 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -120,9 +120,10 @@ class echo(Command): class cd(Command): - """:cd [-r] + """:cd [-r] The cd command changes the directory. + If the path is a file, selects that file. The command 'cd -' is equivalent to typing ``. Using the option "-r" will get you to the real path. """ -- cgit 1.4.1-2-gfad0