mirror of
https://github.com/SikongJueluo/cc-utils.git
synced 2025-11-29 21:07:49 +08:00
feature: cli framework
This commit is contained in:
32
src/lib/ccCLI/index.ts
Normal file
32
src/lib/ccCLI/index.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* CC:Tweaked CLI Framework
|
||||
*
|
||||
* A functional-style CLI framework for CC:Tweaked and TSTL.
|
||||
* This framework provides a declarative way to define command-line interfaces with support
|
||||
* for nested commands, arguments, options, and Result-based error handling.
|
||||
*/
|
||||
|
||||
// --- Core public API ---
|
||||
export { createCli } from "./cli";
|
||||
|
||||
// --- Type definitions for creating commands ---
|
||||
export type {
|
||||
Command,
|
||||
Argument,
|
||||
Option,
|
||||
ActionContext,
|
||||
CliError,
|
||||
UnknownCommandError,
|
||||
MissingArgumentError,
|
||||
MissingOptionError,
|
||||
NoActionError,
|
||||
} from "./types";
|
||||
|
||||
// --- Utility functions for help generation and advanced parsing ---
|
||||
export { generateHelp, generateCommandList, shouldShowHelp } from "./help";
|
||||
export {
|
||||
parseArguments,
|
||||
validateRequiredArgs,
|
||||
validateRequiredOptions,
|
||||
normalizeOptions,
|
||||
} from "./parser";
|
||||
Reference in New Issue
Block a user