mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 04:32:01 +03:00
22 lines
670 B
TypeScript
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() )
|
|
) );
|
|
} );
|
|
}
|
|
}
|