Skip to content

Bash completion - #226

Merged
tyru merged 7 commits into
masterfrom
bash-completion
Apr 6, 2018
Merged

tyru merged 7 commits into
masterfrom
bash-completion

Conversation

@tyru

@tyru tyru commented Apr 6, 2018

Copy link
Copy Markdown
Member

Fix #225

Add modified version of @AvianY's script.

Comment thread _shellcomp/volt Outdated
}

all_plugs() {
volt list -f "{{ range .Repos }}{{ println .Path }}{{ end }}" | sed -e 's/github\.com\///' | sed -e '/^www\./d' | sort

@tyru tyru Apr 6, 2018 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@AvianY Are there any reason for sed -e '/^www\./d' of original script?
maybe #207 related issue, but I couldn't clearly figure out why it is necessary.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I removed those lines, because the completion is only for username/package.
If the packages, which have to be parsed, were repeated ( because of github and www.github duality), there would be twice the same package in the list and I didn't want this to give me any problems, so I removed it

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I see. So how about this?
... | sed -E 's@^(www\.)?github\.com/@@' | sort -u

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes! this solves it!
I didn't know that '-u' option for sort. This is good 👍

Comment thread _shellcomp/volt Outdated
}

this_plug() {
volt list -f "{{ range .Profiles }}{{ if eq \"$1\" .Name }}{{ range .ReposPath }}{{ println . }}{{ end }}{{ end }}{{ end }}" | sed -e 's/github\.com\///' | sed -e '/^www\./d' | sort

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ditto

@tyru
tyru merged commit 1b69f50 into master Apr 6, 2018
@tyru
tyru deleted the bash-completion branch April 6, 2018 18:03
@tyru
tyru restored the bash-completion branch April 6, 2018 18:05
@tyru tyru mentioned this pull request Apr 6, 2018
@tyru

tyru commented Apr 6, 2018

Copy link
Copy Markdown
Member Author

oops, wrongly merged into master... this should be merged into devel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants