Skip to main content

write arguments in a box to the standard output

Project description

Installation

pip install pnu-echobox

ECHOBOX(1)

NAME

echobox - write arguments in a box to the standard output

SYNOPSIS

echobox [-a|--align name] [-b|--basic-char char] [-f|--fill-char char] [-i|--inter-lines number] [-l|--lead-lines number] [-S|--style name] [-s|--spaces number] [-t|--trail-lines number] [--debug] [--help|-?] [--version] [--] [string ...]

DESCRIPTION

The echobox utility writes any specified operands, separated by single blank (' ') characters, in a box, to the standard output. The "\n" substring is used to split the concatenated operands into multiple lines.

If there are no arguments provided on the command line, standard input is read.

OPTIONS

Options Use
-a|--align name Sets the alignment to use. Possible values: left (default), center, middle, right.
-b|--basic-char char Sets the character to use with the basic style. Default value: '#'.
-f|--fill-char char Sets the character to use to fill the box. Default value: ' '.
-i|--inter-lines number Sets the number of lines separating the text from the box on the top and bottom sides. Default value: 1.
-l|--lead-lines number Sets the number of blank lines preceding the box. Default value: 0.
-S|--style name Sets the style to use. Possible values: basic (default), ascii, single, curved, hatched, double, block.
-s|--spaces number Sets the number of spaces separating the text from the box on the left and right sides. Default value: 3.
-t|--trail-lines number Sets the number of blank lines following the box. Default value: 1.
--debug Enable debug level messages.
--help|-? Print usage and a short help message and exit.
--version Print version and exit.
-- Options processing terminator. Contrarily to the echo(1) command, it is recognized as such.

ENVIRONMENT

Environment variables are processed first and thus overridden by command line options.

Variable Use
ECHOBOX_STYLE Sets the style to use.
ECHOBOX_ALIGN Sets the alignment to use.
ECHOBOX_BASIC_CHAR Sets the character to use with the basic style.
ECHOBOX_FILL_CHAR Sets the character to use to fill the box.
ECHOBOX_SPACES Sets the number of spaces separating the text from the box on the left and right sides.
ECHOBOX_INTER_LINES Sets the number of lines separating the text from the box on the top and bottom sides.
ECHOBOX_LEAD_LINES Sets the number of blank lines preceding the box.
ECHOBOX_TRAIL_LINES Sets the number of blank lines following the box.
ECHOBOX_DEBUG Enable debug level messages.
COLUMNS Defines the number of columns in the terminal window. This variable is sometimes provided by the Bash shell and some others, but not necessarily exported. It's used for center and right alignments. Default value: 80.

EXIT STATUS

The echobox utility exits 0 on success, and >0 if an error occurs.

SEE ALSO

dialog(1)

https://en.wikipedia.org/wiki/Box-drawing_character

https://unicode-table.com/fr/#box-drawing

STANDARDS

The echobox command is not a standard UNIX/POSIX command.

It tries to follow the PEP 8 style guide for Python code.

PORTABILITY

Tested OK under Windows, though some of the styles are not available (the hatched and curved Unicode characters are not fully recognized in the cmd.exe and PowerShell command prompts).

HISTORY

The echobox command was created as an example for the PNU / PyNIX project, demonstrating how to process the environment and the command line, and use the Python logging module.

LICENSE

This utility is available under the 3-clause BSD license.

AUTHORS

Hubert Tournier

CAVEATS

Specifying a basic or fill Unicode characters is not currently possible with the environment and command line options.

Display will overflow if your text is wider than your console.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pnu_echobox-1.2.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

pnu_echobox-1.2.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file pnu_echobox-1.2.0.tar.gz.

File metadata

  • Download URL: pnu_echobox-1.2.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for pnu_echobox-1.2.0.tar.gz
Algorithm Hash digest
SHA256 30f7bb5fe8d9fb537a86f6f5014b07d1324403462dc2c07d47773612349a0050
MD5 af3184908abf045da3bcaae18eac4e4d
BLAKE2b-256 7a0928dd240a4f77ff7411b04f1b06e97950338c438602f18814ffa45f4609dd

See more details on using hashes here.

File details

Details for the file pnu_echobox-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pnu_echobox-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for pnu_echobox-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c823d468282bd52d0a0fbd8448f56373c2b2eb1ad77c10569466731f62036e46
MD5 776d1d45d0cddeba0b9072d03758c9aa
BLAKE2b-256 20175a701b64cd487ba182abb5595cfd144a081566cfd784dcb1f025f83927c8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page