config+lnd+lncli: add commit back to version string

This commit is contained in:
Oliver Gugger 2020-04-14 11:13:11 +02:00
parent ec5bfd3df7
commit 1e3b0672d7
No known key found for this signature in database
GPG Key ID: 8E4256593F177720
3 changed files with 6 additions and 4 deletions

@ -205,7 +205,7 @@ func extractPathArgs(ctx *cli.Context) (string, string, error) {
func main() {
app := cli.NewApp()
app.Name = "lncli"
app.Version = build.Version()
app.Version = build.Version() + " commit=" + build.Commit
app.Usage = "control plane for your Lightning Network Daemon (lnd)"
app.Flags = []cli.Flag{
cli.StringFlag{

@ -478,7 +478,8 @@ func loadConfig() (*config, error) {
appName = strings.TrimSuffix(appName, filepath.Ext(appName))
usageMessage := fmt.Sprintf("Use %s -h to show usage", appName)
if preCfg.ShowVersion {
fmt.Println(appName, "version", build.Version())
fmt.Println(appName, "version", build.Version(),
"commit="+build.Commit)
os.Exit(0)
}

5
lnd.go

@ -170,8 +170,9 @@ func Main(lisCfg ListenerCfg) error {
}()
// Show version at startup.
ltndLog.Infof("Version: %s, build=%s, logging=%s",
build.Version(), build.Deployment, build.LoggingType)
ltndLog.Infof("Version: %s commit=%s, build=%s, logging=%s",
build.Version(), build.Commit, build.Deployment,
build.LoggingType)
var network string
switch {