This commit is contained in:
sujit
2025-09-18 08:52:38 +05:45
parent f7f011db3d
commit 651c7335bc
8 changed files with 873 additions and 278 deletions

View File

@@ -1,22 +1,26 @@
package main
import (
"flag"
"log"
"os"
)
func main() {
// Check for config file argument
configPath := "sms-app.json"
if len(os.Args) > 1 {
configPath = os.Args[1]
// Parse command line flags
configPath := flag.String("config", "sms-app.json", "Path to JSON configuration file")
flag.Parse()
// If positional args provided, use the first one
if len(os.Args) > 1 && !flag.Parsed() {
*configPath = os.Args[1]
}
// Create JSON engine
engine := NewJSONEngine()
// Load configuration
if err := engine.LoadConfiguration(configPath); err != nil {
if err := engine.LoadConfiguration(*configPath); err != nil {
log.Fatalf("Failed to load configuration: %v", err)
}