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

Adding bash completion script #1010

Closed
wants to merge 1 commit into from
Closed

Adding bash completion script #1010

wants to merge 1 commit into from

Conversation

agnivade
Copy link
Member

  • Added as a build hook which will re-generate the list of
    commands and update the completion file
  • The way to re-generate the file is not very elegant because of the sed-replace thingy in the template file. But it should do the job.

- Added as a build hook which will re-generate the list of
commands and update the completion file
@agnivade
Copy link
Member Author

xRef- #1000

@rubenvereecken
Copy link
Contributor

Oh man this was a long time coming. Sorry I never saw #1000, I should have responded there before. I actually have a zsh completion script, not sure where it is though, hang on.

@rubenvereecken
Copy link
Contributor

Alright this is really weird I can't find it anywhere on Github, although I know there was a discussion on this at some point. Maybe the link was removed at some point? Anywhere here goes https://gist.github.com/rubenvereecken/53d4c9173bf80245dff1155f902077a7. I guess we should add this in somewhere again.

What I wanted to share with you is this bit: pages=$(tldr -a1). Now, I don't know about bash and I don't care to find out by myself right now, but could this approach work for bash as well? We updated the client to manage this exactly for this reason.

Here's the rest it can show

@rubenvereecken
Copy link
Contributor

Found it again, it's at the tldr-node-client repo: https://github.com/tldr-pages/tldr-node-client/blob/master/autocompletion/tldr.bash

@agnivade
Copy link
Member Author

@rubenvereecken - This is really great :) With your permission, I will include the zsh completion script as well.

My only concern is that the switch "-a1" might be a bit client specific, isn't it ? Are we sure other clients implement this switch ?

Also, the "--*" flags seem to be client specific. IMO, the source repo should not be concerned about specific switches of every client. What do you think about it ?

@waldyrious
Copy link
Member

We've discussed in #824 and #744 about providing a specification for tldr clients in the tldr.md page, which all supported clients would have to conform to. This is clearly one of the use cases that would benefit from this :)

@rubenvereecken
Copy link
Contributor

The client specificity is exactly the reason why I think a completion script should not be bundled with the main repo. People will miss out on client-specific completions because they'll never install those.

We did want to make the listing behavior standard. After all, it's useful for all clients. Never got around to it I think.

@agnivade
Copy link
Member Author

Ah, interesting. I think we can enforce the list-all behavior on all clients. I don't care about the "-1". I can do the rest of it with bash.

But we are still undecided on the "--" flags. I agree with @rubenvereecken here because a proper completion script to complete "--" as well as the command argument. But that is not possible in the main repo. In that case, this task is better suited to be tackled by clients as done by the tldr-node-client.

@waldyrious waldyrious added architecture Organization of the pages per language, platform, etc. clients Issues pertaining to a particular client or the clients as whole. labels Aug 31, 2016
@stale stale bot added the waiting Issues/PRs with Pending response by the author. label May 6, 2017
@stale
Copy link

stale bot commented May 6, 2017

Hi all! This thread has not had any recent activity. Are there any updates? Thanks!

@agnivade
Copy link
Member Author

agnivade commented May 6, 2017

@waldyrious - This PR is only open due to #1065 (comment). Do you think this can be tracked in the parent issue itself ? Since this PR actually is never going to be merged (because autocompletion will be implemented by individual clients), I propose to either track it in the parent issue or open a new issue to track it.

@stale stale bot removed the waiting Issues/PRs with Pending response by the author. label May 6, 2017
@waldyrious
Copy link
Member

Agreed @agnivade -- I've added a comment there to make sure the intentions are clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture Organization of the pages per language, platform, etc. clients Issues pertaining to a particular client or the clients as whole.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants