NAME

Term::CLI::Argument::Filename - class for file name arguments in Term::CLI

VERSION

version 0.059000

SYNOPSIS

use Term::CLI::Argument::Filename;

my $arg = Term::CLI::Argument::Filename->new(name => 'arg1');

DESCRIPTION

Class for file name arguments in Term::CLI(3p). Inherits from the Term::CLI::Argument(3p) class.

CLASS STRUCTURE

Inherits from:

Term::CLI::Argument(3p).

Consumes:

None.

CONSTRUCTORS

See Term::CLI::Argument(3p).

ACCESSORS

See Term::CLI::Argument(3p).

METHODS

See Term::CLI::Argument(3p). Additionally:

complete ( TEXT )
complete ( TEXT, STATE )

Complete the (partial) filename in TEXT. The STATE HashRef is ignored.

If present, this uses the filename_completion_function function listed in Term::ReadLine's Attribs, otherwise it will use the glob_complete method.

Not every Term::ReadLine implementation implements its own filename completion function. The ones that do will have the Attrib->{filename_completion_function} attribute set. Term::ReadLine::Gnu does this, while Term::ReadLine::Perl doesn't.

glob_complete ( TEXT )
glob_complete ( TEXT, STATE )

Complete the (partial) filename in TEXT. The STATE HashRef is ignored.

Implementation uses bsd_glob from File::Glob and applies some decorations on the filenames based on their type, similar to what Term::ReadLine::Gnu does.

SEE ALSO

Term::CLI::Argument(3p), Term::ReadLine::Gnu(3p), File::Glob(3p), Term::CLI(3p).

AUTHOR

Steven Bakker <sbakker@cpan.org>, 2022.

COPYRIGHT AND LICENSE

Copyright (c) 2022 Steven Bakker

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See "perldoc perlartistic."

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.