fix samba-tool --version

samba-tool -V is supposed to give you the version number, but it has not been working consistently.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15770

These patches add tests for that, fix it, and make --version work with all samba-tool subcommands. Previously you could get the version with some subcommands but not others. We remove the need for sub-commands to explicitly add version options, which reduces clutter in the run() method. Also we make --version trump --help, for the sake of consistency. And now --help tells you the version anyway.

Checklist

  • Commits have Signed-off-by: with name/author being identical to the commit author
  • Test suite updated with functionality tests

Reviewer's checklist:

  • There is a test suite reasonably covering new functionality or modifications
  • Function naming, parameters, return values, types, etc., are consistent and according to README.Coding.md
  • This feature/change has adequate documentation added
  • No obvious mistakes in the code

Merge request reports

Loading