tsk-6: Added version package (#10)

Closes #6

Reviewed-on: #10
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2025-11-09 03:23:29 +00:00
committed by phoenix
parent 6bd1b22e68
commit 73a23c4503
3 changed files with 42 additions and 23 deletions
+9 -19
View File
@@ -1,26 +1,26 @@
package main
import "fmt"
import "os"
import (
// "flag"
"fmt"
"os"
"git.kundeng.us/phoenix/sender/config"
"git.kundeng.us/phoenix/sender/messaging"
"git.kundeng.us/phoenix/sender/models"
"git.kundeng.us/phoenix/sender/util"
// "git.kundeng.us/phoenix/sender/version"
"git.kundeng.us/phoenix/sender/version"
)
func main() {
fmt.Println(config.App_Name)
myArgs := os.Args
argCount := len(myArgs)
fmt.Printf("Argument count: %v\n", argCount)
if argCount < 4 {
if config.IsVersionFlagPresent() {
fmt.Println(config.App_Name)
fmt.Println(version.String())
return
} else if argCount < 4 {
fmt.Printf("Argument count: %v\n", argCount)
fmt.Println("Provide argument to config file and number file")
os.Exit(-1)
}
@@ -29,16 +29,6 @@ func main() {
fmt.Printf("Config file path: %s\n", configPath)
// TODO: For version
/*
versionFlag := flag.Bool("version", false, "Print version information")
flag.Parse()
if *versionFlag {
fmt.Println(version.String())
return
}
*/
cfg, _ := config.ParseConfig(configPath)
cfg.PrintConfig()