From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

NAME

MooseX::App::Plugin::ZshCompletion - zsh completion for your MooseX::App applications

SYNOPSIS

In your base class:

package MyApp;
use MooseX::App qw/ ZshCompletion /;

In your .zshrc:

fpath=('/path/to/completion-dir' $fpath)

In your shell

zsh% myapp zsh_completion > /path/to/completion-dir/_myapp
zsh% chmod u+x /path/to/completion-dir/_myapp
zsh% exec zsh

DESCRIPTION

This plugin generates a zsh completion definition for your application.

Completion works for subcommands, parameters and options. If an option or parameter is declared as an enum with Moose::Meta::TypeConstraint you will get a completion for the enum values.

Option completions will show its descriptions also.

The default completion type for parameters is _files

In the examples directory you find moosex-app-zsh.

% moosex-app-zsh <TAB>
bash_completion fetch_mail help lala zsh_completion
% moosex-app-zsh fetch_mail server.example -<TAB>
--dir -- Output 'dir'
--max -- Maximum number of emails to fetch
--servertype -- Mailserver type: IMAP or POP3
--usage --help -h -- Prints this usage information.
--user -- User
--verbose -- be verbose
% moosex-app-zsh fetch_mail server.example --servertype <TAB>
IMAP POP3

METHODS

plugin_metaroles

SEE ALSO

MooseX::App::Plugin::BashCompletion

LICENSE

COPYRIGHT AND LICENSE

Copyright (C) 2015 by Tina Mueller

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file.