Skip to content

Conversation

@tyru
Copy link
Member

@tyru tyru commented Apr 6, 2018

Fix #225

Add modified version of @AvianY's script.

_shellcomp/volt Outdated
}

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

@tyru tyru Apr 6, 2018

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
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
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
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 👍

_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
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
Copy link
Member Author

tyru commented Apr 6, 2018

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.

3 participants