Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cacjs/cac
/ functions
Functions
52 in github.com/cacjs/cac
⨍
Functions
52
◇
Types & classes
16
↓ 13 callers
Function
cac
(name = '')
src/index.ts:7
↓ 13 callers
Method
parse
* Parse argv
src/cac.ts:174
↓ 11 callers
Method
option
* Add a global CLI option. * * Which is also applied to sub-commands.
src/cac.ts:92
↓ 10 callers
Method
command
* Add a sub-command
src/cac.ts:76
↓ 8 callers
Method
action
(callback: (...args: any[]) => any)
src/command.ts:111
↓ 6 callers
Method
help
* Show help message when `-h, --help` flags appear. *
src/cac.ts:101
↓ 3 callers
Function
example
(file: string)
tests/index.test.ts:7
↓ 3 callers
Method
example
* Add a global example. * * This example added here will not be used by sub-commands.
src/cac.ts:123
↓ 3 callers
Method
version
* Show version number when `-v, --version` flags appear. *
src/cac.ts:112
↓ 2 callers
Method
alias
(name: string)
src/command.ts:106
↓ 2 callers
Function
camelcaseOptionName
(name: string)
src/utils.ts:156
↓ 2 callers
Method
checkOptionValue
* Check if the required string-type options exist
src/command.ts:294
↓ 2 callers
Function
removeBrackets
(v: string)
src/utils.ts:3
↓ 1 callers
Function
camelcase
(input: string)
src/utils.ts:96
↓ 1 callers
Method
checkRequiredArgs
()
src/command.ts:258
↓ 1 callers
Method
checkUnknownOptions
* Check if the parsed options contain any unknown options * * Exit and output error when true
src/command.ts:273
↓ 1 callers
Method
checkUnusedArgs
* Check if the number of args is more than expected
src/command.ts:314
↓ 1 callers
Function
findAllBrackets
(v: string)
src/utils.ts:7
↓ 1 callers
Function
findLongest
(arr: string[])
src/utils.ts:88
↓ 1 callers
Function
getFileName
(input: string)
src/utils.ts:151
↓ 1 callers
Function
getMriOptions
(options: Option[])
src/utils.ts:51
↓ 1 callers
Function
getOutput
(file: string, args: string[] = [])
tests/index.test.ts:29
↓ 1 callers
Function
getRuntimeProcessArgs
()
src/runtime.ts:26
↓ 1 callers
Method
hasOption
* Check if an option is registered in this command * @param name Option name
src/command.ts:136
↓ 1 callers
Method
isMatched
* Check if a command name is matched by this command * @param name Command name
src/command.ts:120
↓ 1 callers
Method
mri
( argv: string[], /** Matched command */ command?: Command, )
src/cac.ts:264
↓ 1 callers
Method
option
* Add a option for this command * @param rawName Raw option name(s) * @param description Option description * @param config Option config
src/command.ts:100
↓ 1 callers
Method
outputHelp
* Output the corresponding help message * When a sub-command is matched, output the help message for the command * Otherwise output the global o
src/cac.ts:134
↓ 1 callers
Method
outputVersion
* Output the version number. *
src/cac.ts:146
↓ 1 callers
Function
padRight
(str: string, length: number)
src/utils.ts:92
↓ 1 callers
Function
parse
(match: string[])
src/utils.ts:17
↓ 1 callers
Method
runMatchedCommand
()
src/cac.ts:342
↓ 1 callers
Function
setByType
( obj: { [k: string]: any }, transforms: { [k: string]: any }, )
src/utils.ts:134
↓ 1 callers
Function
setDotProp
( obj: Record<string, any>, keys: string[], val: any, )
src/utils.ts:104
↓ 1 callers
Method
setParsedInfo
( { args, options }: ParsedArgv, matchedCommand?: Command, matchedCommandName?: string, )
src/cac.ts:150
↓ 1 callers
Function
snapshotOutput
({ title, file, args, }: { title: string file: string args?: string[] })
tests/index.test.ts:14
↓ 1 callers
Method
unsetMatchedCommand
()
src/cac.ts:166
↓ 1 callers
Method
usage
* Add a global usage text. * * This is not used by sub-commands.
src/cac.ts:68
Method
allowUnknownOptions
()
src/command.ts:73
Method
constructor
(rawName: string, description: string, config?: OptionConfig)
src/option.ts:22
Method
constructor
* @param name The program name to display in help and version message
src/cac.ts:52
Method
constructor
(message: string)
src/utils.ts:168
Method
constructor
( rawName: string, description: string, config: CommandConfig | undefined = {}, cli: CAC, )
src/command.ts:50
Method
constructor
(cli: CAC)
src/command.ts:330
Method
example
(example: CommandExample)
src/command.ts:89
Method
ignoreOptionDefaultValue
()
src/command.ts:78
Method
isDefaultCommand
()
src/command.ts:124
Method
isGlobalCommand
()
src/command.ts:128
Method
outputHelp
()
src/command.ts:143
Method
outputVersion
()
src/command.ts:250
Method
usage
(text: string)
src/command.ts:68
Method
version
(version: string, customFlags = '-v, --version')
src/command.ts:83