summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2010-08-18 15:57:33 +0200
committerDieter Plaetinck <dieter@plaetinck.be>2010-08-18 15:57:33 +0200
commitd899eaeeed6e91031b8b4e3a4ed64cb31410a51f (patch)
treea372c89b691137d931804b6e747a246ed87cb642
parent801a8144e3c8451294e043656526d4c3e95ff725 (diff)
automatically call libui_sh_init at the end of the file
automatically call libui_sh_init at the end of the file with default options, this way applications using libui-sh are not forced to call libui_sh_init themselves, which was a bit a cumbersome requirement, especially if default options were fine.
-rw-r--r--libui.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/libui.sh b/libui.sh
index 0b5ae6a..8f6ede3 100644
--- a/libui.sh
+++ b/libui.sh
@@ -5,7 +5,8 @@
# TODO: figure out something to make dia windows always big enough, yet fit nicely in the terminal
-# you should call this function when you want to use this library (can be called multiple times, to change ui type or other settings)
+# you can call this function to change settings, before calling other libui functions or afterwards
+# it must always be called at least once to set the right variables, but it gets automatically called once at the end of this file
# $1 ui type (dia or cli). defaults to cli
# $2 directory for tmp files. default /tmp (leave empty for default)
# $3 logfile (or string of logfiles, separated by whitespace) (leave empty to disable logging)
@@ -729,3 +730,7 @@ _cli_follow_progress ()
[ -n "$3" ] && tail -f $2 --pid=$3
[ -z "$3" ] && tail -f $2
}
+
+
+libui_sh_init
+