slitaz-base-files annotate doc/libtaz.txt @ rev 221

libtaz.sh: add new functions - optlist and longline
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Aug 24 14:48:45 2013 +0300 (2013-08-24)
parents b2311939ad7e
children 29f028ec8077
rev   line source
pankso@139 1
pankso@139 2 SYNOPSIS
pankso@139 3 . /lib/libtaz.sh
pankso@139 4 function
pankso@139 5
pankso@139 6 DESCRIPTION
pankso@139 7 LibTaz is the base SliTaz SHell library used by almost all tools and
paul@166 8 utilities. It provides common SHell script functions, parses the cmdline
pankso@164 9 options and store values in a variable. The output messages can be
paul@166 10 formatted for raw/text, gtk, html and by default they are formatted for
pankso@139 11 a standard terminal supporting colors. LibTaz is in the directory
pankso@139 12 /lib/libtaz.sh since it is used when /usr may not be mounted.
pankso@164 13
pankso@139 14 FUNCTIONS
al@221 15 _ <string> Short name for "eval_gettext string; echo"
al@221 16 _n <string> Short name for "eval_gettext string"
pankso@167 17 status Return command status [Done|Failed]
pankso@167 18 separator Display a line separator
pankso@167 19 newline Echo a new line if gettext or echo -n is used
al@221 20 boldify <string> Use a bold font for term, html or GTK output
al@221 21 colorize NB <string> Colorize a string in term mode
pankso@171 22 indent NB [string] Indent text in term mode
al@221 23 emsg <string> Output mark up messages
pankso@167 24 check_root Check if user is logged as root
al@221 25 debug <string> Display a DEBUG message when --debug is used
pankso@167 26 confirm Read answer to confirm an action
al@221 27 log <string> Log activity, $activity must be set
al@221 28 optlist <lines> Prints two-column list (of options, or functions, etc.)
al@221 29 longline <string> Wrap words in long terminal message
pankso@139 30
pankso@139 31 OPTIONS
pankso@139 32 --output=[raw|gtk|html]
pankso@164 33 --activity=/path/files/activity
pankso@164 34
pankso@164 35 EXAMPLES
pankso@164 36 log "Message"
pankso@164 37 check_root
al@193 38 emsg "<b>bold</b> <c 31>red</c> <c 32>green</c> separator<-> newline<n> <i 26>indent"
al@221 39 optlist "\
al@221 40 option1 Description1 (after one or any number of tab symbols)
al@221 41 format $(_ 'disk') $(_ 'Format a specified disk')"
pankso@139 42
paul@166 43 AUTHORS
al@221 44 Christophe Lincoln
al@221 45 Aleksej Bobylev
pankso@164 46