Skip to content

Commit

Permalink
पुनरीक्षण
Browse files Browse the repository at this point in the history
  • Loading branch information
boseji committed Aug 20, 2024
1 parent 42a56dc commit ec5745b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ package main
import (
"context"
"flag"
"fmt"
"log"
"os"
"os/signal"
Expand All @@ -57,6 +58,10 @@ import (
"time"
)

const (
version = "0.0.3"
)

func main() {
var wg sync.WaitGroup
var cfg cfg
Expand All @@ -65,12 +70,26 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

fmt.Println("\n go-mli Boseji's Golang MQTT Logging command line")
fmt.Println("--------------------------------------------------")
fmt.Println(" Version: " + version)
fmt.Println()
defer fmt.Println() // Clearing the Last line

// Define Flags
cfgFile := flag.String("config", "config.json",
"JSON File containing the Configuration.")
ver := flag.Bool("v", false, "Version number of the program")
flag.Parse()

log.Println("[main] Flag ", flag.Parsed())
log.Println("[main] Flag Processed: ", flag.Parsed())

// Print version only
if *ver {
log.Println("[main] Program Version :" + version)
return
}

// Get the Config File
configFile, err := filepath.Abs(*cfgFile)
if err != nil {
Expand Down

0 comments on commit ec5745b

Please sign in to comment.