Project

General

Profile

Actions

Task #1575

closed

add `--version` option to nfd and nrd commands

Added by Alex Afanasyev almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Tools
Target version:
Start date:
05/02/2014
Due date:
% Done:

100%

Estimated time:
3.00 h

Description

Other command-line tools should probably also support --version.

Actions #1

Updated by Alex Afanasyev almost 10 years ago

  • Category set to Tools
  • Target version set to v0.1
Actions #2

Updated by Junxiao Shi almost 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)

Actions #3

Updated by Junxiao Shi almost 10 years ago

This feature is unnecessary. User can always observe NFD version with nfd-status.

Actions #4

Updated by Beichuan Zhang almost 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.

Actions #5

Updated by Alex Afanasyev almost 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...

Actions #6

Updated by Davide Pesavento almost 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.

Actions #7

Updated by Junxiao Shi almost 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).

Actions #8

Updated by Alex Afanasyev almost 10 years ago

  • Assignee changed from Davide Pesavento to Alex Afanasyev
Actions #9

Updated by Alex Afanasyev almost 10 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 70
Actions #10

Updated by Alex Afanasyev almost 10 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 70 to 100
Actions #11

Updated by Davide Pesavento almost 10 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF