perlancar > Perinci-Examples-Bin-Classic-0.06 > peri-eg-test-completion

Download:
Perinci-Examples-Bin-Classic-0.06.tar.gz

Annotate this POD

Website

View/Report Bugs
Source  

NAME ^

peri-eg-test-completion - Do nothing, return args

VERSION ^

This document describes version 0.06 of peri-eg-test-completion (from Perl distribution Perinci-Examples-Bin-Classic), released on 2015-02-06.

SYNOPSIS ^

Usage:

 % peri-eg-test-completion [options] [i1] [a1] ...

DESCRIPTION ^

This function is used to test argument completion.

OPTIONS ^

* marks required options.

--a1-json=s

{en_US Array of strings, where the string has "in" schema clause} (JSON-encoded).

See --a1.

--a1-yaml=s

{en_US Array of strings, where the string has "in" schema clause} (YAML-encoded).

See --a1.

--a1=s@

{en_US Array of strings, where the string has "in" schema clause}.

{en_US Completion library can perhaps complete from the `in` value and remember completed items when command-line option is repeated, e.g. in:

    --a1 <tab>

it will complete from any `in` value, but in:

    --a1 apple --a1 <tab>

it can exclude `apple` from the completion candidate.

Currently the completion library `Perinci::Sub::Complete` does not do this though. Perhaps there can be an option to toggle this behavior. }

Can be specified multiple times.

--a2-json=s

{en_US Array with element_completion routine that generate random letter} (JSON-encoded).

See --a2.

--a2-yaml=s

{en_US Array with element_completion routine that generate random letter} (YAML-encoded).

See --a2.

--a2=s@

{en_US Array with element_completion routine that generate random letter}.

Can be specified multiple times.

--a3-json=s

{en_US Array with element_completion routine that dies} (JSON-encoded).

See --a3.

--a3-yaml=s

{en_US Array with element_completion routine that dies} (YAML-encoded).

See --a3.

--a3=s@

{en_US Array with element_completion routine that dies}.

{en_US See also `s3`. }

Can be specified multiple times.

--arg0-json=s

{en_US Argument without any schema} (JSON-encoded).

See --arg0.

--arg0-yaml=s

{en_US Argument without any schema} (YAML-encoded).

See --arg0.

--arg0=s

{en_US Argument without any schema}.

{en_US }

--config-path=s

{en_US Set path to configuration file}.

Can be specified multiple times.

--config-profile=s

{en_US Set configuration profile to use}.

--f0=f

{en_US Float with just "float" schema defined}.

--f1=f

{en_US Float with xmin/xmax on the schema}.

{en_US A completion library can attempt to provide some possible and incremental completion (e.g. if word is currently at one decimal digit like 1.2, it can provide completion of 1.20 .. 1.29). }

--format-options=s

{en_US Pass options to formatter}.

--format=s

{en_US Choose output format, e.g. json, text}.

--help, -h, -?

{en_US Display this help message}.

--i0=i

{en_US Integer with just "int" schema defined}.

{en_US }

--i1=i

{en_US Integer with min/xmax on the schema}.

{en_US A completion library (like `Perinci::Sub::Complete`) can generate a list of completion from the low end to the high end of the range, as long as it is not too long. }

--i2=i

{en_US Integer with large range min/max on the schema}.

{en_US Unlike in `i1`, a completion library probably won't generate a number sequence for this argument because they are considered too long (1000+ items). }

--json

{en_US Equivalent to --format=json-pretty}.

--no-config

{en_US Do not use any configuration file}.

--s1=s

{en_US String with possible values in "in" schema clause}.

Valid values:

 ["apple", "apricot", "banana", "grape", "grapefruit", "red date", "red grape", "green grape"]
--s1b=s

{en_US String with possible values in "in" schema clause, contains special characters}.

Valid values:

 ["space: ", "word containing spaces", "single-quote: '", "double-quote: \"", "slash/", "back\\slash", "tab\t", "word:with:colon", "dollar \$sign", "various parenthesis: [ ] { } ( )", "tilde ~", "backtick `", "caret^", "at\@", "pound#", "percent%", "ampersand&", "question?", "wildcard*", "comma,", "semicolon;", "pipe|", "redirection > <", "plus+"]

{en_US This argument is intended to test how special characters are escaped. }

--s2=s

{en_US String with completion routine that generate random letter}.

--s3=s

{en_US String with completion routine that dies}.

{en_US Completion should not display error (except perhaps under debugging). It should just provide no completion. }

--version, -v

FILES ^

~/.conf

/etc/.conf

COMPLETION ^

This script has shell tab completion capability with support for several shells.

bash

To activate bash completion for this script, put:

 complete -C peri-eg-test-completion peri-eg-test-completion

in your bash startup (e.g. ~/.bashrc). Your next shell session will then recognize tab completion for the command. Or, you can also directly execute the line above in your shell to activate immediately.

It is recommended, however, that you install shcompgen which allows you to activate completion scripts for several kinds of scripts on multiple shells. Some CPAN distributions (those that are built with Dist::Zilla::Plugin::GenShellCompletion) will even automatically enable shell completion for their included scripts (using shcompgen) at installation time, so you can immadiately have tab completion.

tcsh

To activate tcsh completion for this script, put:

 complete peri-eg-test-completion 'p/*/`peri-eg-test-completion`/'

in your tcsh startup (e.g. ~/.tcshrc). Your next shell session will then recognize tab completion for the command. Or, you can also directly execute the line above in your shell to activate immediately.

It is also recommended to install shcompgen (see above).

other shells

For fish and zsh, install shcompgen as described above.

HOMEPAGE ^

Please visit the project's homepage at https://metacpan.org/release/Perinci-Examples-Bin-Classic.

SOURCE ^

Source repository is at https://github.com/perlancar/perl-Perinci-Examples-Bin.

BUGS ^

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Perinci-Examples-Bin-Classic

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.

AUTHOR ^

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2015 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.

syntax highlighting: