Skip to content

Commit db1fcce

Browse files
authored
Merge pull request #39 from jrswab/add-version-flag
Added flag to output the current version.
2 parents ecc59c3 + bcc0cc3 commit db1fcce

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
### Added
10+
- `-v` flag to display the current version of lsq.
911

1012
## [0.10.2] - 2025-01-03
1113
### Added

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ If no editor is defined in $EDITOR, then `Vim` will be used.
3131
- `-o`: Automatically open the first result from the search.
3232
- `-p`: Open a specific page from the pages directory.
3333
- `-s`: Specify the journal date to open. (Must be `yyyy-MM-dd` formatted)
34+
- `-v`: Display the version of lsq being executed. (Added in v0.11.0)
3435

3536
### Configuration File
3637
This file must be stored in your config directory as `lsq/config.edn`.

main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
"github.com/jrswab/lsq/trie"
1414
)
1515

16+
const semVer string = "0.11.0"
17+
1618
func main() {
1719
// File Path Override
1820
lsqDirPath := flag.String("d", "", "The path to the Logseq directory to use.")
@@ -24,9 +26,15 @@ func main() {
2426
pageToOpen := flag.String("p", "", "Open a specific page from the pages directory. Must be a file name with extention.")
2527
specDate := flag.String("s", "", "Open a specific journal. Use yyyy-MM-dd after the flag.")
2628
useTUI := flag.Bool("t", false, "Use the custom TUI instead of directly opening the system editor")
29+
version := flag.Bool("v", false, "Display current lsq version")
2730

2831
flag.Parse()
2932

33+
if *version {
34+
fmt.Println(semVer)
35+
os.Exit(0)
36+
}
37+
3038
cfg, err := config.Load()
3139
if err != nil && !os.IsNotExist(err) {
3240
// The user has a config file but we couldn't read it.

0 commit comments

Comments
 (0)