-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(daemon): print version #5503
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment.
It should also likely have a sharness test case.
cmd/ipfs/daemon.go
Outdated
@@ -191,6 +193,11 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment | |||
log.Errorf("Injecting prometheus handler for metrics failed with message: %s\n", err.Error()) | |||
} | |||
|
|||
// print the ipfs version | |||
fmt.Printf("go-ipfs version: %s\n"+ | |||
"Repo version: %d\nSystem version: %s\nGolang version: %s\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use separate Printf
for each line.
If not than at least be consistent and remove the "+" operator and put everything on one line.
|
License: MIT Signed-off-by: Overbool <overbool.xu@gmail.com>
e13abfa
to
7d7bca0
Compare
No, this isn't right, pushed a fix in #5507 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
We should modify printVersion() to take an io.Writer and fix the ipfs version
command to use printVersion
but that can be done in a separate commit.
(:+1: to what @kevina said) |
@Stebalien @kevina Which package should we use to put some common functions(like |
@overbool |
License: MIT
Signed-off-by: Overbool overbool.xu@gmail.com
Fixes: #5498