Dist::Zilla::Plugin::GenShellCompletion - Generate shell completion scripts when distribution is installed
This document describes version 0.11 of Dist::Zilla::Plugin::GenShellCompletion (from Perl distribution Dist-Zilla-Plugin-GenShellCompletion), released on 2016-04-20.
In your dist.ini:
[GenShellCompletion]
This plugin modifies Makefile.PL so that when a user installs your distribution with make install, shcompgen is invoked to generate shell completion scripts for your scripts. This is convenient because immediately after the user installs your distribution, shell tab completion is already activated for your scripts.
Makefile.PL
make install
shcompgen recognizes several ways/hints to generate completion to your scripts. Please see its documentation for more details.
Some notes:
First, user must already install and setup shcompgen prior to installing your distribution. But if shcompgen is installed after your distribution is installed, she can simply run shcompgen generate to scan PATH and generate completion for all recognized programs, including yours.
shcompgen
shcompgen generate
Second, this plugin's implementation strategy is currently as follow (probably hackish): insert some code in the generated Makefile.PL after WriteMakefile() to insert some targets in the Makefile generated by Makefile.PL.
WriteMakefile()
Makefile
Third, currently only MakeMaker is supported, Module::Build is not.
Please visit the project's homepage at https://metacpan.org/release/Dist-Zilla-Plugin-GenShellCompletion.
Source repository is at https://github.com/perlancar/perl-Dist-Zilla-Plugin-Rinci-InstallCompletion.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-GenShellCompletion
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
CLI scripts using the Perinci::CmdLine framework will automatically have shell tab completion capability. shcompgen detects this.
You can also use Getopt::Long::Complete or Getopt::Long::Subcommand. shcompgen also detects this.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2016 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Dist::Zilla::Plugin::GenShellCompletion, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dist::Zilla::Plugin::GenShellCompletion
CPAN shell
perl -MCPAN -e shell install Dist::Zilla::Plugin::GenShellCompletion
For more information on module installation, please visit the detailed CPAN module installation guide.