cmd/cored: add version cmd line flag #520

Merged
merged 3 commits into from Feb 13, 2017

Projects

None yet

4 participants

@ameets
Contributor
ameets commented Feb 13, 2017

No description provided.

@erykwalder
Contributor

Note to reviewers: this will change the log prefixes.

log.SetPrefix("cored-" + buildTag + ": ")
chainlog.SetPrefix(append([]interface{}{"app", "cored", "buildtag", buildTag, "processID", processID}, race...)...)
@ameets ameets added the PTAL label Feb 13, 2017
cmd/cored/main.go
+ flag.Parse()
+
+ if *v {
+ fmt.Printf("cored version: %s production=%t\n", config.Version, config.Production)
@kr
kr Feb 13, 2017 Member

🚲🏠 can I request "cored %s production=%t" as the format string?

@kr
kr Feb 13, 2017 Member

my rationale:

  • less stutter (the command already says -version)
  • closer to the GNU style (for whatever that's worth)
  • looks nicer to my eye
@kr
kr Feb 13, 2017 Member

actually, can we put the production=%t on a separate line? it would also be nice to put the buildCommit and buildDate as well, since they're available.

I want to use this format:

cored 1.1
production=true
build-commit=abc123
build-date=2017-02-13T21:28:52Z

or

cored 1.1+changes
production=false
build-commit=?
build-date=?

(I'll do the same in signerd.)

@erykwalder
Contributor

updated, PTAL

@kr
kr approved these changes Feb 13, 2017 View changes
@kr
Member
kr commented Feb 13, 2017

LGTM

ameets added some commits Feb 13, 2017
@ameets @chainbot ameets cmd/cored: add version cmd line flag 85072c0
@ameets @chainbot ameets print production mode 4174d87
@ameets @chainbot ameets additional build information for version cmd
f6f6c50
@chainbot chainbot merged commit d741f5c into main Feb 13, 2017

3 checks passed

licence/cla Contributor License Agreement is signed.
Details
wercker/cored Wercker pipeline passed
Details
wercker/java Wercker pipeline passed
Details
@chainbot chainbot deleted the version-flag branch Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment