Blame Manuals/tcar_printMessage.sh.asciidoc

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