Getopt...::Term(3pm)

πŸ“¦ version 2.000011, in ubuntu stonking

πŸ’– NAME πŸ’–

Getopt::Yath::Term β€” Terminal utility methods πŸŽ€

so this is the 3pm page for Getopt...::Term, hanging out in the User Contributed Perl Documentation section. hi bestie, come get your terminal text handled. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: you've got text, and you want it to look cute in a terminal. that's literally it. these are functions for manipulating text intended for the terminal β€” sizing it, coloring it, wrapping it so it doesn't spill off the edge like an overstuffed purse. no cap, that's the whole job. ✨


🌈 SYNOPSIS 🌈

use Getopt::Yath::Term qw{
    USE_COLOR
    color
    fit_to_width
    term_size
};

πŸ‘‘ EXPORTS πŸ‘‘

$bool = USE_COLOR()

returns true if color can/should be used. it's giving a vibe check for your terminal β€” if this comes back true, go off, use color. πŸ’…

$ansi_escape = color($color_name)

hands you the ANSI escape sequence for the color name you asked for. if color cannot be used, you get an empty string back β€” not a crash, not an error, just "". graceful. iconic. 😌

$new_text = fit_to_width($join, $text, %params)

wraps text so it fits all nice and tidy in the terminal. 🌸

  • $join is the string used to join words together (typically " ").
  • $text is either a plain string β€” which gets split on whitespace β€” or an arrayref of parts.

supported params, bestie:

  • prefix => $string β€” a string to prepend to each output line, like " " when you want indentation. princess treatment for your paragraphs. πŸ‘‘
  • width => $columns β€” target width in columns. defaults to the terminal width minus 20, with a minimum of 80.

$cols = term_size()

gets you the width of the terminal in columns. simple, useful, no notes. πŸŽ€


πŸ”— SOURCE πŸ”—

the source code repository for Getopt-Yath lives at <http://github.com/Test-More/Getopt-Yath/> β€” go be nosy, you're allowed. πŸ’œ


πŸ› οΈ MAINTAINERS πŸ› οΈ

Chad Granum <exodist@cpan.org>


✍️ AUTHORS ✍️

Chad Granum <exodist@cpan.org>


Copyright Chad Granum <exodist7@gmail.com>.

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

See <http://dev.perl.org/licenses/>


and that's the whole page, bestie. this was Getopt...::Term(3pm) from perl v5.40.1, dated 2026-05-10 β€” go wrap some text and slay. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from