Blame Automation/Manuals/tcar_printMessage.sh.asciidoc

Alain Reguera Delgado 8ea9a9
tcar_printMessage.sh(1)
Alain Reguera Delgado 8ea9a9
=======================
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
== Name
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
tcar_printMessage.sh - Print customized messages in standard ways.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
== Synopsis
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
*tcar_printMessage "MESSAGE" [--as-separator-line|--as-banner-line|--as-cropping-line|--as-tuningup-line|--as-checking-line|--as-combining-line|--as-creating-line|--as-reading-line|--as-savedas-line|--as-linkto-line|--as-movedto-line|--as-validating-line|--as-template-line|--as-configuration-line|--as-palette-line|--as-reponse-line|--as-request-line|--as-selection-line|--as-error-line|--as-toknowmore-line|--as-yesornorequest-line|--as-notrailingnew-line|--as-stdout-line|--as-stderr-line]*
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
== Description
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
The *tcar_printMessage* function standardizes the way centos-art.sh
Alain Reguera Delgado 8ea9a9
scirpt prints messages. By default, centos-art.sh script prints all
Alain Reguera Delgado 8ea9a9
messages to the standard output with the exception of those messages
Alain Reguera Delgado 8ea9a9
printed with the *--as-stderr-line* option, which are printed to
Alain Reguera Delgado 8ea9a9
standard error output instead.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
The *tcar_printMessage* function requires two arguments.  The first
Alain Reguera Delgado 8ea9a9
argument specifies the message you want to print and the second
Alain Reguera Delgado 8ea9a9
argument specifies the format you'll use to print that message.
Alain Reguera Delgado 8ea9a9
Because this function is so used inside the centos-art.sh script, it
Alain Reguera Delgado 8ea9a9
is convenient to provide localization to strings passed as +MESSAGE+
Alain Reguera Delgado 8ea9a9
using *gettext* constructions when they aren't paths.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
== Options
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
The *tcar_printMessage* function accepts the following format options
Alain Reguera Delgado 8ea9a9
as second argument:
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-separator-line::
Alain Reguera Delgado 8ea9a9
    This format takes the first character passed as +MESSAGE+ and
Alain Reguera Delgado 8ea9a9
    repeats it horizontally to build a separator line.  Use this
Alain Reguera Delgado 8ea9a9
    format whenever you need to create a logical separation between
Alain Reguera Delgado 8ea9a9
    different actions.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-banner-line::
Alain Reguera Delgado 8ea9a9
    This format takes the string passed as +MESSAGE+ and puts it
Alain Reguera Delgado 8ea9a9
    inside two horizontal separator lines. Use this format whenever
Alain Reguera Delgado 8ea9a9
    you need to print header information for following lines.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-cropping-line::
Alain Reguera Delgado 8ea9a9
    This format is for two columns messages where +MESSAGE+ generally
Alain Reguera Delgado 8ea9a9
    refers to a file inside the repository.  Use this format whenever
Alain Reguera Delgado 8ea9a9
    you need to imply the fact that certain file has been cropped.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-tuningup-line::
Alain Reguera Delgado 8ea9a9
    This format is for two columns messages where +MESSAGE+ generally
Alain Reguera Delgado 8ea9a9
    refers to a file inside the repository.  Use this format whenever
Alain Reguera Delgado 8ea9a9
    you need to imply the fact that certain file has been tuned-up.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-checking-line::
Alain Reguera Delgado 8ea9a9
    This format is for two columns messages where +MESSAGE+ generally
Alain Reguera Delgado 8ea9a9
    refers to a file inside the repository.  Use this format whenever
Alain Reguera Delgado 8ea9a9
    you need to imply the fact that certain file has been checked or
Alain Reguera Delgado 8ea9a9
    verified (e.g., through *tcar_checkFiles* functionality).
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-combining-line::
Alain Reguera Delgado 8ea9a9
    This format is for two columns messages where +MESSAGE+ generally
Alain Reguera Delgado 8ea9a9
    refers to a file inside the repository.  Use this format whenever
Alain Reguera Delgado 8ea9a9
    you need to imply the fact that certain file has been combined.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-creating-line::
Alain Reguera Delgado 8ea9a9
    This format is for two columns messages where +MESSAGE+ generally
Alain Reguera Delgado 8ea9a9
    refers to a file inside the repository.  Use this format whenever
Alain Reguera Delgado 8ea9a9
    you need to imply the fact that certain file has been created.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-reading-line::
Alain Reguera Delgado 8ea9a9
    This format is for two columns messages where +MESSAGE+ generally
Alain Reguera Delgado 8ea9a9
    refers to a file inside the repository.  Use this format whenever
Alain Reguera Delgado 8ea9a9
    you need to imply the fact that certain file has been read.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-savedas-line::
Alain Reguera Delgado 8ea9a9
    This format is for two columns messages where +MESSAGE+ generally
Alain Reguera Delgado 8ea9a9
    refers to a file inside the repository.  Use this format whenever
Alain Reguera Delgado 8ea9a9
    you need to imply the fact that certain file has been saved.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-linkto-line::
Alain Reguera Delgado 8ea9a9
    This format is for two columns messages where +MESSAGE+ generally
Alain Reguera Delgado 8ea9a9
    refers to a file inside the repository.  Use this format whenever
Alain Reguera Delgado 8ea9a9
    you need to imply the fact that certain file has been linked.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-movedto-line::
Alain Reguera Delgado 8ea9a9
    This format is for two columns messages where +MESSAGE+ generally
Alain Reguera Delgado 8ea9a9
    refers to a file inside the repository.  Use this format whenever
Alain Reguera Delgado 8ea9a9
    you need to imply the fact that certain file has been moved.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-validating-line::
Alain Reguera Delgado 8ea9a9
    This format is for two columns messages where +MESSAGE+ generally
Alain Reguera Delgado 8ea9a9
    refers to a file inside the repository.  Use this format whenever
Alain Reguera Delgado 8ea9a9
    you need to imply the fact that certain file has been validated.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-template-line::
Alain Reguera Delgado 8ea9a9
    This format is for two columns messages where +MESSAGE+ generally
Alain Reguera Delgado 8ea9a9
    refers to a file inside the repository.  Use this format whenever
Alain Reguera Delgado 8ea9a9
    you need to imply the fact that certain file is a template or
Alain Reguera Delgado 8ea9a9
    design model.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-configuration-line::
Alain Reguera Delgado 8ea9a9
    This format is for two columns messages where +MESSAGE+ generally
Alain Reguera Delgado 8ea9a9
    refers to a file inside the repository.  Use this format whenever
Alain Reguera Delgado 8ea9a9
    you need to imply the fact that certain file is a configuration
Alain Reguera Delgado 8ea9a9
    file.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-palette-line::
Alain Reguera Delgado 8ea9a9
    This format is for two columns messages where +MESSAGE+ generally
Alain Reguera Delgado 8ea9a9
    refers to a file inside the repository.  Use this format whenever
Alain Reguera Delgado 8ea9a9
    you need to imply the fact that certain file is a palette of
Alain Reguera Delgado 8ea9a9
    colors.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-response-line::
Alain Reguera Delgado 8ea9a9
    This format adds +-->+ at the beginning of the string passed as
Alain Reguera Delgado 8ea9a9
    +MESSAGE+.  Use this format whenever you need to imply the fact
Alain Reguera Delgado 8ea9a9
    that certain file is considered part of a response.  For example,
Alain Reguera Delgado 8ea9a9
    when you need to express that a group of files will take certain
Alain Reguera Delgado 8ea9a9
    action, you can use this option to doing so.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-request-line::
Alain Reguera Delgado 8ea9a9
    This format prints +MESSAGE+ without trailing new line.  Use this
Alain Reguera Delgado 8ea9a9
    format whenever you need to imply a question or yes or no request.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-selection-line::
Alain Reguera Delgado 8ea9a9
    This format uses each word in +MESSAGE+ as item of a selection
Alain Reguera Delgado 8ea9a9
    list. Use this format whenever you need to select one of the items
Alain Reguera Delgado 8ea9a9
    provided as +MESSAGE+.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-error-line::
Alain Reguera Delgado 8ea9a9
    This format prints error messages produced by centos-art.sh
Alain Reguera Delgado 8ea9a9
    script. It uses the *caller* built-in command to display the line
Alain Reguera Delgado 8ea9a9
    number and the filename where such error was triggered. Later, it
Alain Reguera Delgado 8ea9a9
    prints where to find more information by using the
Alain Reguera Delgado 8ea9a9
    *--as-toknowmore-line* option.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-toknowmore-line::
Alain Reguera Delgado 8ea9a9
    This format takes a function name as +MESSAGE+ and prints the
Alain Reguera Delgado 8ea9a9
    command you can use to find more information about it. When this
Alain Reguera Delgado 8ea9a9
    option is passed the script finishes its execution immediately.
Alain Reguera Delgado 8ea9a9
    This option is used in combination with *--as-error-line* to
Alain Reguera Delgado 8ea9a9
    finish the script execution after an error.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-yesornorequest-line::
Alain Reguera Delgado 8ea9a9
    This format takes a question as +MESSAGE+ and reads a yes or no
Alain Reguera Delgado 8ea9a9
    answer. When answer is negative, the script finishes its execution
Alain Reguera Delgado 8ea9a9
    immediately. When answer is affirmative, the script continues its
Alain Reguera Delgado 8ea9a9
    execution normally. 
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-notrailingnew-line::
Alain Reguera Delgado 8ea9a9
    Print +MESSAGE+ without any trailing
Alain Reguera Delgado 8ea9a9
    newline.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
--as-stdout-line::
Alain Reguera Delgado 8ea9a9
    Print +MESSAGE+ to standard output.
Alain Reguera Delgado 8ea9a9
    
Alain Reguera Delgado 8ea9a9
--as-stderr-line::
Alain Reguera Delgado 8ea9a9
    Print +MESSAGE+ to standard error output.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
== Examples
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
...
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
== Bugs
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
See https://centos.org.cu/bugs/
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
== Authors
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
The *tcar_printMessage* function has received contributions from the
Alain Reguera Delgado 8ea9a9
following people:
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
- Alain Reguera Delgado <al@centos.org.cu>, =COPYRIGHT_YEAR_LIST=
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
== License
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
Copyright (C) =COPYRIGHT_YEAR_LIST= =COPYRIGHT_HOLDER=
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
This program is free software; you can redistribute it and/or modify
Alain Reguera Delgado 8ea9a9
it under the terms of the GNU General Public License as published by
Alain Reguera Delgado 8ea9a9
the Free Software Foundation; either version 2 of the License, or (at
Alain Reguera Delgado 8ea9a9
your option) any later version.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
This program is distributed in the hope that it will be useful, but
Alain Reguera Delgado 8ea9a9
WITHOUT ANY WARRANTY; without even the implied warranty of
Alain Reguera Delgado 8ea9a9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Alain Reguera Delgado 8ea9a9
General Public License for more details.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
You should have received a copy of the GNU General Public License
Alain Reguera Delgado 8ea9a9
along with this program; if not, write to the Free Software
Alain Reguera Delgado 8ea9a9
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Alain Reguera Delgado 8ea9a9
Alain Reguera Delgado 8ea9a9
// vim: set syntax=asciidoc:
Alain Reguera Delgado 8ea9a9
// vim: set syntax=asciidoc: