mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 16:23:12 +09:00
Split up commands into separate modules (#844)
Ctl's commands.ts was starting to grow rather big, and future features and refactors are only going to make it bigger. Split it up into separate modules grouped by which category of commands it serves.
This commit is contained in:
1 parent
94692dc418
commit
9877946d68
13 files changed
+2347
-2259
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import asTableModule from "as-table";
|
||||
|
||||
import * as lib from "@clusterio/lib";
|
||||
import type { Control } from "../ctl";
|
||||
import { print } from "./command_ops";
|
||||
|
||||
const asTable = asTableModule.configure({ delimiter: " | " });
|
||||
|
||||
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, control: Control) {
|
||||
let permissions = await control.send(new lib.PermissionListRequest());
|
||||
print(asTable(permissions));
|
||||
},
|
||||
}));
|
||||
Reference in new issue
Block a user