swc/bundler/tests/.cache/deno/78684882ae1fd30151abacef77d1f388b92a405b.ts
강동윤 fec189f2f3
fix(bundler): Fix stack overflow on Windows (#1464)
bundler:
 - Prevent stack overflow. (denoland/deno#9752)

testing:
 - Bump version
 - Fix handling of paths on windows.

testing_macros:
 - Bump version
 - Correctly ignore files.
2021-03-22 19:42:42 +09:00

22 lines
566 B
TypeScript

// Loaded from https://deno.land/x/cliffy@v0.18.0/command/types/child_command.ts
import type { Command } from "../command.ts";
import { StringType } from "./string.ts";
/** String type with auto completion of child command names. */
export class ChildCommandType extends StringType {
#cmd?: Command;
constructor(cmd?: Command) {
super();
this.#cmd = cmd;
}
/** Complete child command names. */
public complete(cmd: Command): string[] {
return (this.#cmd ?? cmd)?.getCommands(false)
.map((cmd: Command) => cmd.getName()) || [];
}
}