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