Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fix an unclear wording in readline.md #12605

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/api/readline.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@ a `'resize'` event on the `output` if or when the columns ever change

### Use of the `completer` Function

When called, the `completer` function is provided the current line entered by
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just provided -> passed?

Copy link
Contributor Author

@vsemozhetbyt vsemozhetbyt Apr 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without a preposition? 'When called, the completer function is passed the current line...'? I am a bit confused by this passive voice. Can we say 'Provide the function a line' without a preposition? It seems we can say 'Pass the function a line', so the passive can be without a preposition here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, passed is transitive so works.

When called, the completer function is provided the current line entered by the user === When the completer function is called (by Node.js), the current line entered by the user is passed to it.

I know we normally prefer the active voice, nothing against using that here, the only issue is that AIUI this is a callback function, so it is called by the Node.js readline code, the arguments are passed into it, and Node expects it to return an Array. So you can't say Provide the function a line, because the user doesn't do that, Node does.

You could maybe say something like:

The completer function takes the current line entered by the user as an argument, and returns an Array with 2 entries:

I defer to you on what's clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I shall use your last variant and let's see if anybody come along with us)

the user, and is expected to return an Array with 2 entries:
The `completer` function takes the current line entered by the user
as an argument, and returns an Array with 2 entries:

* An Array with matching entries for the completion.
* The substring that was used for the matching.
Expand Down