NAME
    Complete::Fish - Completion module for fish shell

VERSION
    This document describes version 0.03 of Complete::Fish (from Perl
    distribution Complete-Fish), released on 2014-11-29.

DESCRIPTION
    fish allows completion of option arguments to come from an external
    command, e.g.:

     % complete -c deluser -l user -d Username -a "(cat /etc/passwd|cut -d : -f 1)"

    The command is supposed to return completion entries one in a separate
    line. Description for each entry can be added, prefixed with a tab
    character. The provided function "format_completion()" accept a
    completion answer structure and format it for fish. Example:

     format_completion(["a", "b", {word=>"c", description=>"Another letter"}])

    will result in:

     a
     b
     c       Another letter

FUNCTIONS
  format_completion($completion) -> array|str
    Format completion for output (for shell).

    fish accepts completion reply in the form of one entry per line to
    STDOUT. Description can be added to each entry, prefixed by tab
    character.

    Arguments ('*' denotes required arguments):

    *   completion* => *array|hash*

        Completion answer structure.

        Either an array or hash, as described in "Complete".

    Return value:

    Formatted string (or array, if `as` key is set to `array`) (any)

  parse_cmdline($cmdline) -> array
    Parse shell command-line for processing by completion routines.

    This function converts COMMAND_LINE (str) given by tcsh to become
    something like COMP_WORDS (array) and COMP_CWORD (int), like what bash
    supplies to shell functions. Currently implemented using
    "Complete::Bash"'s "parse_cmdline".

    Arguments ('*' denotes required arguments):

    *   cmdline => *str*

        Command-line, defaults to COMMAND_LINE environment.

    Return value:

     (array)

    Return a 2-element array: "[$words, $cword]". $words is array of str,
    equivalent to "COMP_WORDS" provided by bash to shell functions. $cword
    is an integer, equivalent to "COMP_CWORD" provided by bash to shell
    functions. The word to be completed is at "$words->[$cword]".

    Note that COMP_LINE includes the command name. If you want the
    command-line arguments only (like in @ARGV), you need to strip the first
    element from $words and reduce $cword by 1.

TODOS
SEE ALSO
    Complete

    Complete::Bash

    Fish manual.

HOMEPAGE
    Please visit the project's homepage at
    <https://metacpan.org/release/Complete-Fish>.

SOURCE
    Source repository is at
    <https://github.com/sharyanto/perl-Complete-Fish>.

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

    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 <perlancar@cpan.org>

COPYRIGHT AND LICENSE
    This software is copyright (c) 2014 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.

