The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Complete::File - Completion routines related to files

VERSION

This document describes version 0.41 of Complete::File (from Perl distribution Complete-File), released on 2016-10-19.

DESCRIPTION

FUNCTIONS

complete_dir(%args) -> array

Complete directory from local filesystem (wrapper for complete_dir() that only picks directories).

This function is not exported by default, but exportable.

Arguments ('*' denotes required arguments):

  • allow_dot => bool (default: 1)

    If turned off, will not allow "." or ".." in path.

    This is most useful when combined with starting_path option to prevent user going up/outside the starting path.

  • filter => str|code

    Only return items matching this filter.

    Filter can either be a string or a code.

    For string filter, you can specify a pipe-separated groups of sequences of these characters: f, d, r, w, x. Dash can appear anywhere in the sequence to mean not/negate. An example: f means to only show regular files, -f means only show non-regular files, drwx means to show only directories which are readable, writable, and executable (cd-able). wf|wd means writable regular files or writable directories.

    For code filter, you supply a coderef. The coderef will be called for each item with these arguments: $name. It should return true if it wants the item to be included.

  • handle_tilde => bool (default: 1)

  • starting_path => str (default: ".")

  • word* => str (default: "")

    Word to complete.

Return value: (array)

complete_file(%args) -> array

Complete file and directory from local filesystem.

This function is not exported by default, but exportable.

Arguments ('*' denotes required arguments):

  • allow_dot => bool (default: 1)

    If turned off, will not allow "." or ".." in path.

    This is most useful when combined with starting_path option to prevent user going up/outside the starting path.

  • filter => str|code

    Only return items matching this filter.

    Filter can either be a string or a code.

    For string filter, you can specify a pipe-separated groups of sequences of these characters: f, d, r, w, x. Dash can appear anywhere in the sequence to mean not/negate. An example: f means to only show regular files, -f means only show non-regular files, drwx means to show only directories which are readable, writable, and executable (cd-able). wf|wd means writable regular files or writable directories.

    For code filter, you supply a coderef. The coderef will be called for each item with these arguments: $name. It should return true if it wants the item to be included.

  • handle_tilde => bool (default: 1)

  • starting_path => str (default: ".")

  • word* => str (default: "")

    Word to complete.

Return value: (array)

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Complete-File.

SOURCE

Source repository is at https://github.com/perlancar/perl-Complete-File.

BUGS

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

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 ALSO

Complete

Other Complete::* modules.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

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