๐Ÿ“‚ command

โšก command::checkParsedResults

A convenience function to check the parsing results and fails with an error message if there are parsing errors. Will also display the help if the help option is true.

This should be called from a command function for which you want to check the parsing results.

It uses the variables help and commandArgumentsErrors to determine if the help should be displayed and if there are parsing errors.

Example usage:

command::checkParsedResults

โšก command::parseArguments

Parse the arguments and options of a function and return a string that can be evaluated to set the variables. This should be called from a command function for which you want to parse the arguments.

See the documentation for more details on the parser: https://jcaillon.github.io/valet/docs/new-commands/#-implement-your-command.

Inputs:

  • $@: arguments as any:

    the arguments to parse

Returns:

  • ${REPLY}: a string that can be evaluated to set the parsed variables

Output example:

local arg1 option1
arg1="xxx"
option1="xxx"

Example usage:

command::parseArguments "$@"; eval "${REPLY}"

โšก command::showHelp

Show the help for the current function. This should be called directly from a command function for which you want to display the help text.

Example usage:

command::showHelp

โšก command::sourceFunction

Source the file associated with a command function. This allows you to call a command function without having to source the file manually.

Inputs:

  • $1: function name as string:

    the function name

Example usage:

command::sourceFunction "functionName"

Important

Documentation generated for the version 0.30.1455 (2025-08-18).