Task #1575
closedadd `--version` option to nfd and nrd commands
100%
Description
Other command-line tools should probably also support --version
.
Updated by Alex Afanasyev over 10 years ago
- Category set to Tools
- Target version set to v0.1
Updated by Junxiao Shi over 10 years ago
Should the version printed include tokens like "rc", "beta"?
Should the version printed include git commit hash? (available only if compiled from git repository)
Updated by Junxiao Shi over 10 years ago
This feature is unnecessary. User can always observe NFD version with nfd-status
.
Updated by Beichuan Zhang over 10 years ago
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.
Updated by Alex Afanasyev over 10 years ago
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...
Updated by Davide Pesavento over 10 years ago
A common way to do that is using the output of git describe --always
, possibly with --tags
and/or --dirty
too, when building from a git checkout.
Updated by Junxiao Shi over 10 years ago
- Assignee set to Davide Pesavento
- Estimated time set to 3.00 h
Information from 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).
Updated by Alex Afanasyev over 10 years ago
- Assignee changed from Davide Pesavento to Alex Afanasyev
Updated by Alex Afanasyev over 10 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 70
Updated by Alex Afanasyev over 10 years ago
- Status changed from In Progress to Code review
- % Done changed from 70 to 100
Updated by Davide Pesavento over 10 years ago
- Status changed from Code review to Closed