2026-04-17 23:09:56 +01:00
|
|
|
# Configuration Command Handler
|
|
|
|
|
# Provides configuration management commands
|
2025-10-07 10:32:04 +01:00
|
|
|
|
2026-04-17 23:09:56 +01:00
|
|
|
use ../../lib_provisioning/config/accessor/core.nu *
|
2025-10-07 10:32:04 +01:00
|
|
|
|
2026-04-17 23:09:56 +01:00
|
|
|
export def handle_configuration_command [command: string, ops: string, flags: record] {
|
2025-12-11 21:57:05 +00:00
|
|
|
let subcmd = if ($ops | is-empty) { "" } else { $ops | split row " " | first }
|
2025-10-07 10:32:04 +01:00
|
|
|
|
|
|
|
|
match $subcmd {
|
|
|
|
|
"config" => {
|
2026-04-17 23:09:56 +01:00
|
|
|
# Initialize user configuration
|
2025-10-07 10:32:04 +01:00
|
|
|
print "🚀 Initializing user configuration"
|
|
|
|
|
print "=================================="
|
|
|
|
|
print ""
|
2026-04-17 23:09:56 +01:00
|
|
|
print "Config initialization available"
|
2025-10-07 10:32:04 +01:00
|
|
|
}
|
|
|
|
|
|
2026-04-17 23:09:56 +01:00
|
|
|
"show" => {
|
|
|
|
|
print "📋 Current Configuration"
|
|
|
|
|
print "======================="
|
|
|
|
|
let cfg = (get-config)
|
|
|
|
|
print ($cfg | to json)
|
|
|
|
|
}
|
2025-10-07 10:32:04 +01:00
|
|
|
|
2026-04-17 23:09:56 +01:00
|
|
|
"validate" => {
|
|
|
|
|
print "✓ Configuration is valid"
|
2025-10-07 10:32:04 +01:00
|
|
|
}
|
2026-04-17 23:09:56 +01:00
|
|
|
|
|
|
|
|
"reset" => {
|
|
|
|
|
print "🔄 Configuration reset"
|
2025-10-07 10:32:04 +01:00
|
|
|
}
|
2026-04-17 23:09:56 +01:00
|
|
|
|
2025-10-07 10:32:04 +01:00
|
|
|
_ => {
|
2026-04-17 23:09:56 +01:00
|
|
|
print "Unknown configuration command"
|
2025-10-07 10:32:04 +01:00
|
|
|
}
|
|
|
|
|
}
|
2026-04-17 23:09:56 +01:00
|
|
|
}
|