AaronErhardt / tuxedo-rs

Rust libraries for interacting with hardware from TUXEDO Computers
GNU General Public License v2.0
138 stars 10 forks source link

tailor_gui: Support `--version` flag as command line argument. #61

Closed mrcjkb closed 6 months ago

mrcjkb commented 8 months ago

Since tailor_gui and tailor are different packages, the release-please workflow updates them with individual semver versions.

In the nixpkgs repo, it would be desirable to use the same source for both packages, to make sure they are compatible with each other (and we don't update one and forget to update the other).

Because they have different versions (and nixpkgs disallows importing the version from Cargo.toml), we have to declare them manually, for both packages. To ensure the declared version is correct for tailor, we run a test, where we run tailor --version. It would be nice to be able to do the same with tailor_gui.

Currently, the CLI output of tailor_gui is

Usage:
  tailor_gui [OPTION…]

Help Options:
  -h, --help                 Show help options
  --help-all                 Show all help options
  --help-gapplication        Show GApplication options

GApplication Options:
  --gapplication-service     Enter GApplication service mode (use from D-Bus service files)

... which appears to be managed by the gtk crate.

@AaronErhardt do you know if it's possible to configure a gtk::Application to take a --version flag? If not, would you be open to adding a clap CLI, which can take a --version flag? It looks like the --gapplication-service option isn't useful (yet?) anyway.

I'd be happy to implement this :smile:

AaronErhardt commented 8 months ago

@AaronErhardt do you know if it's possible to configure a gtk::Application to take a --version flag?

Yes, but we probably want to use clap anyway because it's much easier. I can try to come up with some code for this over the next few days.