- core/framework/flag.sh: flag::define, flag::parse, accessors - core/framework/hook.sh: hook::on, hook::fire, hook::off, hook::has - core/framework/help.sh: help::section, command::help::auto - core/framework/command.sh: command::define, command::route, lazy loading - core restructure: framework/ + app/ separation - load_command: directory-based command detection - command::exists: accepts new-style commands - command::run: routing for new-style, legacy fallback - commands/logs/: migrated to new framework - logs.sh: router + command::define - show.sh: flag::define + flag::parse, no manual case blocks - clean.sh: flag::define + flag::parse - remove.sh: flag::define + flag::parse - rotate.sh: flag::define + flag::parse - logs clean: fix dry_run bool to int conversion - ctx::json_helper: fixed path after core restructure - PYTHONPATH: exported in app/core.sh
22 lines
No EOL
744 B
Bash
22 lines
No EOL
744 B
Bash
#!/usr/bin/env bash
|
|
# commands/logs/remove.sh
|
|
|
|
function cmd::logs::remove::on_load() {
|
|
flag::define --name value "Filter by peer name" [label="name"]
|
|
flag::define --since value "Remove entries since" [label="time"]
|
|
flag::define --fw bool "Remove firewall logs only"
|
|
flag::define --wg bool "Remove WireGuard logs only"
|
|
flag::define --force bool "Skip confirmation"
|
|
}
|
|
|
|
function cmd::logs::remove::run() {
|
|
flag::parse "$@" || return 1
|
|
local name; name=$(flag::value --name)
|
|
local since; since=$(flag::value --since)
|
|
local force=false fw=false wg=false
|
|
flag::bool --force && force=true
|
|
flag::bool --fw && fw=true
|
|
flag::bool --wg && wg=true
|
|
|
|
cmd::logs::_remove_impl "$name" "$since" "$fw" "$wg" "$force"
|
|
} |