Getopt::Complete::Cache - cache options next-to the command they apply-to
This document describes Getopt::Complete::Cache 0.25.
Presuming MyApp.pm isa Command, and "myapp" is an executable like:
use MyApp; MyApp->execute_with_shell_params_and_exit();
Add this BEFORE using the MyApp module:
use Getopt::Complete::Cache class => 'MyApp'; use MyApp; MyApp->execute_with_shell_params_and_exit();
Now the shell will look for MyApp.pm.opts during completion and will never actually load the MyApp.pm module during tab-completion.
The .opts file is autogenerated upon the first attempt to find it.
This module is for the obscure case in which: 1. the compile time on an executable is sluggish, and we don't want to have sluggish tab-completion 2. the command-line should be cached relative to a given module name
This is most useful with classes implementing the Command.pm API. Since these modules may form a large command tree, the caching occurs at individual levels in the tree separately.
To install Getopt::Complete, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Getopt::Complete
CPAN shell
perl -MCPAN -e shell install Getopt::Complete
For more information on module installation, please visit the detailed CPAN module installation guide.