App-ansiecho

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

    echo "${color[2]} Green ${reset}"
    echo "${color[3]} Blue  ${reset}"

# COMMAND OPTIONS

- **-n**

    Do not print newline at the end.

- **-e**, **--**\[**no-**\]**escape**

    Enable interpretation of backslash escapes in the normal string
    argument.  This option is enabled by default, unlike bash built-in
    [echo(1)](http://man.he.net/man1/echo) command.  Use **--no-escape** to disable it.

- **-j**, **--join**

    Do not print space between arguments.  This is a short-cut for
    `--separate ''`.

- **--separate** _string_

    Set separator string between arguments.

- **--**\[**no-**\]**rgb24**

    Produce 24bit full-color sequence for 12bit/24bit specified colors.
    They are converted to 216 colors by default.

- **-h**, **--help**

    Print help.

- **-v**, **--version**

    Print version.

# PREFIX OPTIONS

- **-s** _spec_

    Print raw ANSI sequence for given _spec_.

- **-c** _spec_ _string_

    Print _string_ in a color given by _spec_.

- **-f** _format_ _args_ ...

    Print _args_ in a given _format_.  Backslash escape is always
    interpreted in the format string.

    The result of **-f** sequence ends up to a single argument, and can be
    a subject of other **-c** or **-f** option.

    Number of arguments are calculated from the number of `%` characters
    in the format string except `%%`.  Variable width and precision
    parameter `*` can be used like `%*s` or `%*.*s`.

    Format string also can be made by **-f** option.  Next commands produce
    same output, but second one looks better.

        ansiecho -f -f '%%%ds' 16 hello

        ansiecho -f '%*s' 16 hello

- **-S** _spec_

    If option `-S` found, all following arguments are considered as a
    color spec given to **-s** option, until option **-E** is found.

    Next two commands are equivalent.

        ansiecho -s ZE -s K/544 -s K/454 -s K/445

        ansiecho -S ZE K/544 K/454 K/445

- **-C** _spec_

    Option **-C** set permanent color which is applied to all following
    arguments until option **-E** found.

    Next command prints only a word `Yellow` in yellow, but second one
    print `Yellow`, `Brick`, and `Road` in yellow.

        ansiecho Follow the -cYS Yellow Brick Road

        ansiecho Follow the -CYS Yellow Brick Road

    You may want to color the phrase instead.

        ansiecho Follow the -cYS "Yellow Brick Road"

    Option `-C` can be used multiple times mixed with `-F` option.  See
    below.

- **-F** _format_

    As with the `-C` option, `-F` defines a format which is applied to
    all arguments until option **-E** found.  Format string have to include
    single `%s` placeholder.

        ansiecho Follow the -CYS -F ' %s ' Yellow Brick Road

    Option **-C** and **-F** can be used repeatedly, and they will take
    effect in the reverse order of their appearance.

    Next command show argument `A` in underline/bold with blinking red
    arrow.

        ansiecho -cRF -f'->%s' -cUD A B C

    Next one does the same thing for all arguments.

        ansiecho -CRF -F'->%s' -CUD A B C
                  ↑    ↑        ↑

- **-E**

    Terminate **-C**, **-F** and **-S** effects.



( run in 0.683 second using v1.01-cache-2.11-cpan-5b529ec07f3 )