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 (until a Control-D (Unix) or Control-Z (Windows) character is sent).
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
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 project, demonstrating how to process the environment and the command line, and use the Python logging module.
It's also used as a filter for fortune(6) output, in order to introduce some boxology.
LICENSE
This utility is available under the 3-clause BSD license.
AUTHORS
CAVEATS
Specifying 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pnu_echobox-1.2.2.tar.gz
.
File metadata
- Download URL: pnu_echobox-1.2.2.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 749244c21ac2994361351dc9833143519d886a501597276fb34e7a6e0aa3660f |
|
MD5 | 924785795efad38e560e6392f28432c9 |
|
BLAKE2b-256 | 0e4c07f4c851369e86140d080dd1fd19f234a8f337b37d1d84b3adff9d2e34c1 |
File details
Details for the file pnu_echobox-1.2.2-py3-none-any.whl
.
File metadata
- Download URL: pnu_echobox-1.2.2-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 458e1f8c512c4c8c98e7f03afa7f4b1ada1afd7641e1ddf1e2fef8cdb3ab264c |
|
MD5 | 43a213318d7575d1de23df735f952b28 |
|
BLAKE2b-256 | 4ae4c69c6f87a76628de5a6b9d4060c281b63462ff2d72aca0aae9c61a9a6444 |