add `--version` option to nfd and nrd commands
Other command-line tools should probably also support
- Category set to Tools
- Target version set to v0.1
Should the version printed include tokens like "rc", "beta"?
Should the version printed include git commit hash? (available only if compiled from git repository)
This feature is unnecessary. User can always observe NFD version with
it shouldn't rely on another program to get the version number. what if nfd cannot successfully run? getting the version number would help debugging, but nfdc won't work.
I agree with Beichuan. Getting version from running NFD is one thing, getting version of the tool / nfd binary is another.
As for the other question. I feel that we should include additional information (e.g., for rc-1, it should mention rc-1). For git source-compiled non-release version it also a good idea to include some part of hash (or just git commit in parentheses). However, we should not include this information when somebody uses source code from git, but compiles the released version...
A common way to do that is using the output of
git describe --always, possibly with
--dirty too, when building from a git checkout.
- Assignee set to Davide Pesavento
- Estimated time set to 3.00 h
core/version.hpp should always be printed.
git describe --always is fine.
The solution should not break when code is not in a git repository (eg. downloaded ZIP from GitHub).
- Assignee changed from Davide Pesavento to Alex Afanasyev
- Status changed from New to In Progress
- % Done changed from 0 to 70
- Status changed from In Progress to Code review
- % Done changed from 70 to 100
- Status changed from Code review to Closed
Also available in: Atom