Getopt...::Term(3pm)
π 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. πΈ
$joinis the string used to join words together (typically" ").$textis 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 Β©οΈ
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
- ubuntu stonking: libgetopt-yath-perl 2.000011-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms