Blame Scripts/Documentation/Reference/Tcar/tcar_printMessage.asciidoc

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