mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-25 18:55:28 -06:00
Add lazygit --v
version
* Recover Rev and Build Date from build args * Moved `debuggingPointer` and `versionFlag` to `var()` * Print version and exit in case of `-v` or `--v`
This commit is contained in:
parent
6cb0a14f33
commit
4d9d2b134f
13
main.go
13
main.go
@ -14,6 +14,10 @@ import (
|
|||||||
var (
|
var (
|
||||||
startTime time.Time
|
startTime time.Time
|
||||||
debugging bool
|
debugging bool
|
||||||
|
Rev string
|
||||||
|
builddate string
|
||||||
|
debuggingPointer = flag.Bool("debug", false, "a boolean")
|
||||||
|
versionFlag = flag.Bool("v", false, "Print the current version")
|
||||||
)
|
)
|
||||||
|
|
||||||
func homeDirectory() string {
|
func homeDirectory() string {
|
||||||
@ -58,11 +62,14 @@ func navigateToRepoRootDirectory() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
debuggingPointer := flag.Bool("debug", false, "a boolean")
|
startTime = time.Now()
|
||||||
flag.Parse()
|
|
||||||
debugging = *debuggingPointer
|
debugging = *debuggingPointer
|
||||||
devLog("\n\n\n\n\n\n\n\n\n\n")
|
devLog("\n\n\n\n\n\n\n\n\n\n")
|
||||||
startTime = time.Now()
|
flag.Parse()
|
||||||
|
if *versionFlag {
|
||||||
|
fmt.Printf("rev=%s, build date=%s", Rev, builddate)
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
verifyInGitRepo()
|
verifyInGitRepo()
|
||||||
navigateToRepoRootDirectory()
|
navigateToRepoRootDirectory()
|
||||||
run()
|
run()
|
||||||
|
Loading…
Reference in New Issue
Block a user