feat: 新增 svc.list/log.list 命令
svc.list 列出所有服务(systemctl/launchctl/sc) log.list 列出可用日志来源(journalctl/日志目录/wevtutil)
This commit is contained in:
@@ -641,6 +641,15 @@ func Builtin() *Registry {
|
||||
},
|
||||
|
||||
// ----- svc -----
|
||||
{
|
||||
ID: "svc.list",
|
||||
Group: "svc",
|
||||
Summary: "列出所有服务",
|
||||
Action: "列出系统中所有服务。" +
|
||||
"Linux: systemctl list-unit-files;macOS: launchctl list;" +
|
||||
"Windows: sc query state= all",
|
||||
Variants: threePlatformBuiltins("svc.list"),
|
||||
},
|
||||
{
|
||||
ID: "svc.status",
|
||||
Group: "svc",
|
||||
@@ -783,6 +792,14 @@ func Builtin() *Registry {
|
||||
},
|
||||
|
||||
// ----- log -----
|
||||
{
|
||||
ID: "log.list",
|
||||
Group: "log",
|
||||
Summary: "列出可用的日志来源",
|
||||
Action: "列出系统中可用的日志来源。" +
|
||||
"Linux: journalctl --list-boots;macOS: 列出日志目录;Windows: wevtutil el",
|
||||
Variants: threePlatformBuiltins("log.list"),
|
||||
},
|
||||
{
|
||||
ID: "log.search",
|
||||
Group: "log",
|
||||
|
||||
@@ -28,12 +28,12 @@ func TestBuiltinIDsStable(t *testing.T) {
|
||||
"disk.usage", "net.pids", "net.ports", "proc.nohup", "proc.wait", "java.run", "git.retime", "pkg.refreshindex",
|
||||
"user.grant", "user.revoke",
|
||||
"file.findbig", "file.findrecent", "file.findname",
|
||||
"svc.status", "svc.enable", "svc.disable", "svc.logs",
|
||||
"svc.list", "svc.status", "svc.enable", "svc.disable", "svc.logs",
|
||||
"archive.extract",
|
||||
"sysinfo",
|
||||
"proc.topmem", "proc.topcpu", "proc.killname",
|
||||
"net.ping", "net.trace", "net.dns", "net.curl",
|
||||
"log.search", "log.last",
|
||||
"log.list", "log.search", "log.last",
|
||||
"fw.status", "fw.allow", "fw.deny",
|
||||
"net.iface", "net.conn", "net.speed",
|
||||
"proc.tree",
|
||||
|
||||
Reference in New Issue
Block a user