danyspin97 / rinstall

Declarative install for programs
GNU General Public License v3.0
28 stars 2 forks source link

add --packaging flag #7

Closed classabbyamp closed 1 year ago

classabbyamp commented 1 year ago

fixes #4

$ cargo run -q -- install --packaging --destdir=/tmp/foo
>>> Package rinstall
Would install target/release/rinstall -> /tmp/foo/usr/local/bin
Would install target/release/man/rinstall.1 -> /tmp/foo/usr/local/share/man/man1
Would install README.md -> /tmp/foo/usr/local/share/doc/rinstall/README.md
Would install target/release/completions/rinstall.bash -> /tmp/foo/usr/local/share/bash-completion/completions
Would install target/release/completions/rinstall.elv -> /tmp/foo/usr/local/share/elvish/lib
Would install target/release/completions/rinstall.fish -> /tmp/foo/usr/local/share/fish/vendor_completions.d
Would install target/release/completions/_rinstall -> /tmp/foo/usr/local/share/zsh/site-functions
Would install LICENSE.md -> /tmp/foo/usr/local/share/licenses/rinstall/LICENSE.md

unfortunately, it sems to be a limitation of clap that it still shows --system as required in this error message:

$ cargo run -q -- install --packaging
error: the following required arguments were not provided:
  --system
  --destdir <DESTDIR>

Usage: rinstall install --system --destdir <DESTDIR> --packaging

For more information, try '--help'.
$ cargo run -q -- install --destdir=/tmp/foo --system --packaging
error: the argument '--system' cannot be used with '--packaging'

Usage: rinstall install --destdir <DESTDIR> --system

For more information, try '--help'.
classabbyamp commented 1 year ago

would be nice if this could be done without the functions, I've asked clap about it here: https://github.com/clap-rs/clap/discussions/4788

danyspin97 commented 1 year ago

Hello and thank you for the PR. I have subscribed to the upstream issue, we can merge this for now and improve the behavior later when upstream gives us someway to do it.