MooseX::App::Plugin::ZshCompletion - zsh completion for your MooseX::App applications
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
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.
enum
Option completions will show its descriptions also.
The default completion type for parameters is _files
_files
In the examples directory you find moosex-app-zsh.
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
MooseX::App::Plugin::BashCompletion
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.
To install MooseX::App::Plugin::ZshCompletion, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::App::Plugin::ZshCompletion
CPAN shell
perl -MCPAN -e shell install MooseX::App::Plugin::ZshCompletion
For more information on module installation, please visit the detailed CPAN module installation guide.