VERSION

This document describes Getopt::Complete::Compgen 0.26.

SYNOPSIS

 # A completion spec can use any of the following, specified by a single
 # word, or a single character, automatically:

 use Getopt::Complete(
    'myfile'    => 'files',         # or 'f'
    'mydir'     => 'directories',   # or 'd'
    'mycommand' => 'commands',      # or 'c'
    'myuser'    => 'users',         # or 'u'
    'mygroup'   => 'groups',        # or 'd'
    'myenv'     => 'environment',   # or 'e'
    'myservice' => 'services',      # or 's'
    'myalias'   => 'aliases',       # or 'a'
    'mybuiltin' => 'builtins'       # or 'b'
 );

DESCRIPTION

This module contains subroutines which can be used as callbacks with Getopt::Complete, and which implement all of the standard completions supported by the bash \*(L"compgen\*(R" builtin.

Running \*(L"compgen -o files abc\*(R" will produce the completion list as though the user typed \*(L"abc<\s-1TAB\s0>\*(R", with the presumption the user is attempting to complete file names.

This module provides a subroutine names \*(L"files\*(R", with an alias named \*(L"f\*(R", which returns the same list.

The subroutine is suitable for use in a callback in a Getopt::Complete competion specification.

It does the equivalent for directories, executable commands, users, groups, environment variables, services, aliases and shell builtins.

These are the same:

@matches = Getopt::Complete::Compgen::files("whatevercommand","abc","whateverparam",$whatever_other_args);

@same = `bash -c "compgen -f sometext"`; chomp @same;

These are equivalent in any spec:

\&Getopt::Complete::Compgen::files \&Getopt;:Complete::Compgen::f 'Getopt::Complete::Compgen::files' 'Getopt;:Complete::Compgen::f' 'files' 'f'

RELATED TO Getopt::Complete::Compgen…

Getopt::Complete

The manual page for bash details the bash built-in command \*(L"compgen\*(R", which this wraps.

COPYRIGHT

Copyright 2010 Scott Smith and Washington University School of Medicine

AUTHORS

Scott Smith (sakoht at cpan .org)

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the \s-1LICENSE\s0 file included with this module.