mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 08:03:13 +09:00
Commands print their results through a CommandOutput on the ctl link.
In json mode lists print as arrays of objects, other results as an
object, commands without a result print {} and failures print
{ error: ClassName, message } with exit code 1. log follow and
debug dump-ws print JSON lines.
Human output now goes through the shared asTable printer in every
command, results that were logged to stderr (role create, save and mod
upload/download) print to stdout, and config edit failures are logged
instead of printed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 lines
430 B
TypeScript
11 lines
430 B
TypeScript
import * as lib from "@clusterio/lib";
|
|
import type { Ctl } from "../ctl.js";
|
|
|
|
export const permissionCommands = new lib.CommandTree({ name: "permission", description: "Permission inspection" });
|
|
permissionCommands.add(new lib.Command({
|
|
definition: [["list", "l"], "List permissions in the cluster"],
|
|
handler: async function(args: object, ctl: Ctl) {
|
|
ctl.output.table(await ctl.send(new lib.PermissionListRequest()));
|
|
},
|
|
}));
|