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

Add grub-file and grub-install completions #4119

Merged
merged 2 commits into from
Jun 14, 2017

Conversation

moverest
Copy link
Contributor

No description provided.

@krader1961
Copy link
Contributor

I'm not a fan of having options after the description but I don't see any obvious problems with this change. So LGTM. I'll merge in a day or two unless @faho or someone else sees a problem.

@faho
Copy link
Member

faho commented Jun 14, 2017

I'll merge in a day or two unless @faho or someone else sees a problem.

Nah. In fact I'll go a step further and merge it now.

@faho faho merged commit be1d32c into fish-shell:master Jun 14, 2017
@moverest moverest deleted the grub-completions branch June 14, 2017 10:44
@faho
Copy link
Member

faho commented Jun 14, 2017

I'm not a fan of having options after the description

In this particular case, I'm actually a fan:

complete -c grub-install -l target -d 'Install GRUB for given platform' -a 'arm-efi\t arm-uboot\t arm64-efi\t i386-coreboot\t i386-efi\t i386-ieee1275\t i386-multiboot\t i386-pc\t i386-qemu\t i386-xen\t ia64-efi\t mips-arc\t mips-qemu_mips\t mipsel-arc\t mipsel-loongson\t mipsel-qemu_mips\t powerpc-ieee1275\t sparc64-ieee1275\t x86_64-efi\t x86_64-xen\t' -x

However, I mostly like it because of the way it looks when wrapped - github happens to wrap after the description. I'd probably make that explicit by breaking after it:

complete -c grub-install -l target -d 'Install GRUB for given platform' \
-a 'arm-efi\t arm-uboot\t arm64-efi\t i386-coreboot\t i386-efi\t i386-ieee1275\t i386-multiboot\t i386-pc\t i386-qemu\t i386-xen\t ia64-efi\t mips-arc\t mips-qemu_mips\t mipsel-arc\t mipsel-loongson\t mipsel-qemu_mips\t powerpc-ieee1275\t sparc64-ieee1275\t x86_64-efi\t x86_64-xen\t' -x

That looks nice and clean, with both the description and the candidates being visible.

If the description were last, it would be easier to overlook after the big chunk of candidates.

What I don't particularly like is how the "-x" is squeezed in there, almost as if @moverest is ashamed of it, but that's such a minute nit that it's not worth holding the PR for.

@moverest
Copy link
Contributor Author

I like the idea of putting the options on a new line.

I find the -x at the end easier to read. At a glance, I can tell which options lack -r, -x or -f when it's at the end of the line. I can read the description and only then tell if the option requires a argument. Whereas, if it's before the description, I have to go back and re-read the line. Plus, it sets it apart from -s. But, if you want it before the description, I'll do that for the next ones. I'm not against one way or the other.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants