testcomp - Test your tab completion
This document describes version 0.180 of testcomp (from Perl distribution App-CompleteUtils), released on 2022-01-16.
Usage (place caret sign (^) somewhere to place cursor):
^
% testcomp [testcomp-options] -- <your-script> [your-script-options]^ ... % testcomp [testcomp-options] -- <your-script> '[your-script-options]^ ...'
Examples:
% testcomp -- yourscript --opt1 val --opt2 % testcomp -Ilib -- 'yourscript --opt1^ --opt2 val'
This utility will run your script (finding it in PATH if not found in current directory) while setting COMP_LINE and COMP_POINT to test how your script will perform shell completion. In addition to that, it will also load Log::ger::Output::Screen and set TRACE=1 to let you see trace log messages.
PATH
COMP_LINE
COMP_POINT
TRACE=1
You can place caret sign (^) somewhere in the argument to place cursor (set COMP_POINT)>. If no caret sign is present, COMP_POINT is put at the end of COMP_LINE.
Like Perl's -I.
-I
Set shell. Currently this has a single effect: if shell is set to tcsh, then COMMAND_LINE will be set for the program instead of COMP_LINE and COMP_POINT. If unspecified, will be detected using Shell::Guess->running_shell.
tcsh
COMMAND_LINE
Shell::Guess->running_shell
Shortcut for --shell=bash.
--shell=bash
Shortcut for --shell=fish.
--shell=fish
Shortcut for --shell=tcsh.
--shell=tcsh
Shortcut for --shell=zsh.
--shell=zsh
Please visit the project's homepage at https://metacpan.org/release/App-CompleteUtils.
Source repository is at https://github.com/perlancar/perl-App-CompleteUtils.
App::CompleteUtils
You can use this utility to test scripts using these frameworks: Perinci::CmdLine, Getopt::Long::Complete, Getopt::Long::Subcommand. But actually all scripts which can complete itself by detecting COMP_LINE and COMP_POINT can be tested.
perlancar <perlancar@cpan.org>
To contribute, you can send patches by email/via RT, or send pull requests on GitHub.
Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then test via:
% prove -l
If you want to build the distribution (e.g. to try to install it locally on your system), you can install Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla plugin and/or Pod::Weaver::Plugin. Any additional steps required beyond that are considered a bug and can be reported to me.
This software is copyright (c) 2022, 2020, 2018, 2017, 2016, 2015, 2014 by perlancar <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.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-CompleteUtils
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.
To install App::CompleteUtils, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::CompleteUtils
CPAN shell
perl -MCPAN -e shell install App::CompleteUtils
For more information on module installation, please visit the detailed CPAN module installation guide.