|
NAMEComplete::Sequence - Complete string from a sequence of choicesVERSIONThis document describes version 0.002 of Complete::Sequence (from Perl distribution Complete-Sequence), released on 2019-12-17.FUNCTIONScomplete_sequenceUsage:complete_sequence(%args) -> array Complete string from a sequence of choices. Sometime you want to complete a string where its parts (sequence items) are formed from various pieces. For example, suppose your program "delete-user-data" accepts an argument that is in the form of: USERNAME UID "(" "current" ")" UID "(" "historical" ")" "EVERYONE" Supposed existing users include "budi", "ujang", and "wati" with UID 101, 102, 103. This can be written as: [ { alternative => [ [qw/budi ujang wati/], {sequence => [ [qw/101 102 103/], ["(current)", "(historical)"], ]}, "EVERYONE", ], } ] When word is empty (''), the offered completion is: budi ujang wati 101 102 103 EVERYONE When word is 101, the offered completion is: 101 101(current) 101(historical) When word is "101(h", the offered completion is: 101(historical) This function is not exported by default, but exportable. Arguments ('*' denotes required arguments):
If you want to specify another sub-sequence of items: {sequence => [ ... ]} # put items in here If you want to specify an alternative of sub-sequences or sub-alternative: {alternative => [ ... ]} # put items in here
Return value: (array) ENVIRONMENTCOMPLETE_SEQUENCE_TRACEBool. If set to true, will display more log statements for debugging.HOMEPAGEPlease visit the project's homepage at <https://metacpan.org/release/Complete-Sequence>.SOURCESource repository is at <https://github.com/perlancar/perl-Complete-Sequence>.BUGSPlease report any bugs or feature requests on the bugtracker website <https://rt.cpan.org/Public/Dist/Display.html?Name=Complete-Sequence>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. SEE ALSOComplete::Path. Conceptually, "complete_sequence" is similar to "complete_path" from Complete::Path. Except unlike a path, a sequence does not (necessarily) have path separator.Complete AUTHORperlancar <perlancar@cpan.org>COPYRIGHT AND LICENSEThis software is copyright (c) 2019 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.
Visit the GSP FreeBSD Man Page Interface. |