]> git.hungrycats.org Git - bees/commit
bees: handle --version and --help/-h before bees initialisation
authorZygo Blaxell <bees@furryterror.org>
Fri, 15 Aug 2025 02:05:29 +0000 (22:05 -0400)
committerZygo Blaxell <bees@furryterror.org>
Sat, 2 May 2026 03:48:58 +0000 (23:48 -0400)
commitee7f7e7e232b251d3274975eb8aac57fbd17ae2e
tree0143c15bad279634349df0d6fe906bf729d7a305
parente08a0349d00b0699674186d5a2bd8183beb8905f
bees: handle --version and --help/-h before bees initialisation

Introduce the standard --version option to print version and exit 0.
Adjust --help/-h to do the same.

Scan argv in main() for standard options before calling bees_main().
This avoids going through config parsing and Chatter log setup that we're
going to throw away immediately.

If neither option appears, write the version on stderr as before.
Since the version string may be critical to debugging the configuration
parsing code, the version string output is unconditional, and occurs
prior to the start of config parsing.

Resolves: https://github.com/Zygo/bees/issues/330
Signed-off-by: Zygo Blaxell <bees@furryterror.org>
src/bees-usage.txt
src/bees.cc