@pnp/cli-microsoft365
Version:
Manage Microsoft 365 and SharePoint Framework projects on any platform
32 lines • 1.18 kB
JavaScript
import { z } from 'zod';
import { autocomplete } from '../../../../autocomplete.js';
import { globalOptionsZod } from '../../../../Command.js';
import AnonymousCommand from '../../../base/AnonymousCommand.js';
import commands from '../../commands.js';
export const options = z.strictObject({
...globalOptionsZod.shape
});
class CliCompletionShSetupCommand extends AnonymousCommand {
get name() {
return commands.COMPLETION_SH_SETUP;
}
get description() {
return 'Sets up command completion for Zsh, Bash and Fish';
}
get schema() {
return options;
}
async commandAction(logger) {
if (this.debug) {
await logger.logToStderr('Generating command completion...');
}
autocomplete.generateShCompletion();
if (this.debug) {
await logger.logToStderr('Registering command completion with the shell...');
}
autocomplete.setupShCompletion();
await logger.log('Command completion successfully registered. Restart your shell to load the completion');
}
}
export default new CliCompletionShSetupCommand();
//# sourceMappingURL=completion-sh-setup.js.map