Skip to content

Commit 3dc161e

Browse files
committed
look at Changes.txt
1 parent 4c391f4 commit 3dc161e

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

CHANGELOGS/Changes.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ CHANGES: 21-06-11-03-2021
2828

2929
CHANGES: 21-06-19-03-2021
3030
- Deleted unnecessary messages
31-
- Added changelogs passing to CLI
31+
- Added changelogs passing to CLI
32+
33+
CHANGES: 21-06-23-03-2021
34+
- Added -version flag

cliTools/loadFlags.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"os/exec"
99
)
1010

11-
func LoadCMD(filepath string, modOrFile string) (string, string, string, string, *bool, bool, string, string, string, string, bool, bool, bool, string, string, bool, bool, bool) {
11+
func LoadCMD(filepath string, modOrFile string, version string) (string, string, string, string, *bool, bool, string, string, string, string, bool, bool, bool, string, string, bool, bool, bool) {
1212
var filepathP *string
1313
cmd := flag.Bool("cmd", false, "a bool")
1414
cnfM := flag.Bool("cnf", false, "a bool")
@@ -30,8 +30,14 @@ func LoadCMD(filepath string, modOrFile string) (string, string, string, string,
3030
updateName := flag.Bool("updateName", false, "a bool")
3131
updateArch := flag.Bool("updateArch", false, "a bool")
3232
updateOS := flag.Bool("updateOS", false, "a bool")
33+
versionF := flag.Bool("version", false, "a bool")
3334
changes := flag.Bool("logChanges", false, "a bool")
3435
flag.Parse()
36+
if *versionF == true {
37+
fullVersion := "GODEMON-" + version + "-" + build.Default.GOOS + "_" + build.Default.GOARCH
38+
color.Yellow(fullVersion)
39+
os.Exit(1)
40+
}
3541
if *changes == true {
3642
godemonPath := os.Getenv("GODEMON")
3743
path := godemonPath + "/CHANGELOGS/Changes.txt"

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func main() {
3030
version := "21.06"
3131
color.HiMagenta("Welcome to godemon " + version)
3232
doneChan := make(chan bool)
33-
filepath, modOrFile, cnf, command, help, init, name, oso, arch, cont, addFile, addCmd, addVar, key, value, updateName, updateArch, updateOS := cliTools.LoadCMD("", "")
33+
filepath, modOrFile, cnf, command, help, init, name, oso, arch, cont, addFile, addCmd, addVar, key, value, updateName, updateArch, updateOS := cliTools.LoadCMD("", "", version)
3434
if cont == "Exit" {
3535
os.Exit(1)
3636
}

0 commit comments

Comments
 (0)