Skip to content

Commit 2669c87

Browse files
committed
config: add version flag
This commit adds a new '--version' flag to litd.
1 parent a9c5764 commit 2669c87

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

config.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ var (
147147
// all config items of its enveloping subservers, each prefixed with their
148148
// daemon's short name.
149149
type Config struct {
150+
ShowVersion bool `long:"version" description:"Display version information and exit."`
151+
150152
HTTPSListen string `long:"httpslisten" description:"The main litd host:port to listen on for incoming HTTP/2 connections. On this port all gRPC services of all enabled daemons are exposed as well as REST (if --enablerest is specified), grpc-web and the web UI itself."`
151153
HTTPListen string `long:"insecure-httplisten" description:"The host:port to listen on with TLS disabled. This is dangerous to enable as credentials will be submitted without encryption. Should only be used in combination with Tor hidden services or other external encryption."`
152154
EnableREST bool `long:"enablerest" description:"Also allow REST requests to be made to the main HTTP(s) port(s) configured above."`
@@ -345,6 +347,10 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
345347
// Show the version and exit if the version flag was specified.
346348
appName := filepath.Base(os.Args[0])
347349
appName = strings.TrimSuffix(appName, filepath.Ext(appName))
350+
if preCfg.ShowVersion {
351+
fmt.Println(appName, "version", Version())
352+
os.Exit(0)
353+
}
348354
if preCfg.Lnd.ShowVersion {
349355
fmt.Println(appName, "version", build.Version(),
350356
"commit="+build.Commit)

docs/release-notes/release-notes-0.13.4.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44

55
### Lightning Terminal
66

7-
- [Fixed a bug where REST calls for the `WalletUnlocker` service weren't allowed
7+
* [Fixed a bug where REST calls for the `WalletUnlocker` service weren't allowed
88
on startup](https://github.com/lightninglabs/lightning-terminal/pull/806).
9-
- [Added build flag 'litd_no_ui' for building litd without the ui, accessible
9+
10+
* [Added build flag 'litd_no_ui' for building litd without the ui, accessible
1011
with 'make go-build-noui' and 'make go-install-noui'](https://github.com/lightninglabs/lightning-terminal/pull/500).
1112

13+
* Add a ['--version'
14+
flag](https://github.com/lightninglabs/lightning-terminal/pull/830) to litd
15+
which can be used to obtain version information of the daemon.
16+
1217
### LND
1318

1419
### Loop
@@ -23,4 +28,5 @@ with 'make go-build-noui' and 'make go-install-noui'](https://github.com/lightni
2328

2429
# Contributors (Alphabetical Order)
2530

31+
* Elle Mouton
2632
* Oliver Gugger

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
var Commit string
1717

1818
// semanticAlphabet
19-
const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-"
19+
const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-."
2020

2121
// These constants define the application version and follow the semantic
2222
// versioning 2.0.0 spec (http://semver.org/).

0 commit comments

Comments
 (0)