mirror of
https://github.com/oarkflow/mq.git
synced 2025-10-07 00:43:35 +08:00
update
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user