pimutils / mates.rs

A very simple commandline addressbook
MIT License
63 stars 9 forks source link

Generate shell completions with clap #18

Closed gnuish closed 6 years ago

gnuish commented 6 years ago

Clap can generate compile-time shell completions. This commit adds support for it, and the completions can then be packaged with distribution (like how Ripgrep does its PKGBUILD) or installed by users.

untitaker commented 6 years ago

Cool stuff, but can you document this in the README as well?

gnuish commented 6 years ago

How about this?

If you'd like the feature, here is the change for the PKGBUILD:

package(){
    cd "$srcdir/$pkgname"
    install -Dm755 target/release/mates "$pkgdir/usr/bin/mates"

    install -Dm644 "target/release/build/mates-"*/out/mates.bash-completion "$pkgdir/usr/share/bash-completion/completions/mates"
    install -Dm644 "target/release/build/mates-"*/out/mates.fish "$pkgdir/usr/share/fish/completions/mates.fish"
    install -Dm644 "target/release/build/mates-"*/out/_mates "$pkgdir/usr/share/zsh/site-functions/_mates"
}
untitaker commented 6 years ago

I'd rather prefer a more verbal description of what to find in target/release (i also maintain the pkgbuild in aur already)

On 30 December 2017 23:55:17 GMT+01:00, Ariel Dabalsa notifications@github.com wrote:

How about this?

If you'd like the feature, here is the change for the PKGBUILD:

package(){
   cd "$srcdir/$pkgname"
   install -Dm755 target/release/mates "$pkgdir/usr/bin/mates"

install -Dm644 "target/release/build/mates-"*/out/mates.bash-completion
"$pkgdir/usr/share/bash-completion/completions/mates"
install -Dm644 "target/release/build/mates-"*/out/mates.fish
"$pkgdir/usr/share/fish/completions/mates.fish"
install -Dm644 "target/release/build/mates-"*/out/_mates
"$pkgdir/usr/share/zsh/site-functions/_mates"
}

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/pimutils/mates.rs/pull/18#issuecomment-354573178

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

gnuish commented 6 years ago

Edited

untitaker commented 6 years ago

Thanks, I also updated the PKGBUILD