swc/crates/swc_bundler/tests/.cache/deno/57f42cd79a814c6352880d2c86a215a83e34fa00.ts
2021-11-09 20:42:49 +09:00

22 lines
670 B
TypeScript

// Loaded from https://deno.land/x/cliffy@v0.12.1/packages/command/commands/completions/zsh.ts
import { Command } from '../../lib/command.ts';
import { ZshCompletionsGenerator } from '../../lib/zsh-completions-generator.ts';
/**
* Generates zsh completion code.
*/
export class ZshCompletionsCommand extends Command {
public constructor( cmd?: Command ) {
super();
this.description( 'Generate zsh shell completions.' )
.action( () => {
Deno.stdout.writeSync( new TextEncoder().encode(
ZshCompletionsGenerator.generate( cmd || this.getMainCommand() )
) );
} );
}
}