diff --git a/src/aliases.ts b/src/aliases.ts index 9e990786..05e1477b 100644 --- a/src/aliases.ts +++ b/src/aliases.ts @@ -4,6 +4,12 @@ export function commandIsAlias(command: string): boolean { return Config.get("exaliases", command) !== undefined } +/** + * Expands the alias in the provided exstr recursively. Does nothing if + * the command is not aliased, including when the command is invalid. + * + * @param exstr :exstr typed by the user on the commantd line + */ export function expandExstr(exstr: string): string { // Split on whitespace const [command, ...args] = exstr.trim().split(/\s+/) @@ -14,6 +20,12 @@ export function expandExstr(exstr: string): string { return expandedExstr } +/** + * Expands the given command recursively. Does nothing if the command is not + * aliased, including when it is invalid. + * + * @param command The command portion of the exstr + */ export function getAliasExpandRecur(command: string): string { // Base case: alias not found; return original command if(!commandIsAlias(command)) {