Migrate from flag to cobra

This commit is contained in:
2025-10-26 16:34:44 +01:00
parent b001dfe667
commit 06aed7b27a
4 changed files with 127 additions and 112 deletions

View File

@@ -1,23 +0,0 @@
package utils
import (
"flag"
logger "git.site.quack-lab.dev/dave/cylogger"
)
// flagsLogger is a scoped logger for the utils/flags package.
var flagsLogger = logger.Default.WithPrefix("utils/flags")
var (
ParallelFiles = flag.Int("P", 100, "Number of files to process in parallel")
Filter = flag.String("f", "", "Filter commands before running them")
JSON = flag.Bool("json", false, "Enable JSON mode for processing JSON files")
Convert = flag.Bool("conv", false, "Convert YAML files to TOML format")
)
func init() {
flagsLogger.Debug("Initializing command-line flags")
flagsLogger.Trace("Initial flag values - ParallelFiles: %d, Filter: %q, JSON: %t, Convert: %t", *ParallelFiles, *Filter, *JSON, *Convert)
flagsLogger.Debug("Flag definitions: -P (parallel files), -f (filter), -json (JSON mode), -conv (YAML to TOML conversion)")
}