NAME Complete::Path - Complete path VERSION This document describes version 0.08 of Complete::Path (from Perl distribution Complete-Path), released on 2015-01-07. DESCRIPTION FUNCTIONS complete_path(%args) -> array {en_US Complete path}. {en_US Complete path, for anything path-like. Meant to be used as backend for other functions like "Complete::Util::complete_file" or "Complete::Module::complete_module". Provides features like case-insensitive matching, expanding intermediate paths, and case mapping. Algorithm is to split path into path elements, then list items (using the supplied "list_func") and perform filtering (using the supplied "filter_func") at every level. } Arguments ('*' denotes required arguments): * ci => *bool* {en_US Case-insensitive matching}. * exp_im_path => *bool* {en_US Expand intermediate paths}. {en_US This option mimics feature in zsh where when you type something like "cd /h/u/b/myscript" and get "cd /home/ujang/bin/myscript" as a completion answer. } * filter_func => *code* {en_US Provide extra filtering. Code will be given path and should return 1 if the item should be included in the final result or 0 if the item should be excluded. } * is_dir_func => *code* {en_US Function to check whether a path is a "dir"}. {en_US Optional. You can provide this function to determine if an item is a "directory" (so its name can be suffixed with path separator). You do not need to do this if you already suffix names of "directories" with path separator in "list_func". One reason you might want to provide this and not mark "directories" in "list_func" is when you want to do extra filtering with "filter_func". Sometimes you do not want to suffix the names first (example: see "complete_file" in "Complete::Util"). } * list_func* => *code* {en_US Function to list the content of intermediate "dirs"}. {en_US Code will be called with arguments: ($path, $cur_path_elem, $is_intermediate). Code should return an arrayref containing list of elements. "Directories" can be marked by ending the name with the path separator (see "path_sep"). Or, you can also provide an "is_dir_func" function that will be consulted after filtering. If an item is a "directory" then its name will be suffixed with a path separator by "complete_path()". } * map_case => *bool* {en_US Treat _ (underscore) and - (dash) as the same}. {en_US This is another convenience option like "ci", where you can type "-" (without pressing Shift, at least in US keyboard) and can still complete "_" (underscore, which is typed by pressing Shift, at least in US keyboard). This option mimics similar option in bash/readline: "completion-map-case". } * path_sep => *str* (default: "/") * starting_path* => *str* (default: "") * word => *str* (default: "") Return value: (array) SEE ALSO Complete HOMEPAGE Please visit the project's homepage at . SOURCE Source repository is at . BUGS Please report any bugs or feature requests on the bugtracker website 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 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.