arch bash cakephp dauth devops drupal fosdem foss git golang information age linux lua mail monitoring music n900 netlog openstack photos php productivity python real life thesis travel uzbl vimeo web2.0

Libui-sh: a library providing UI functions for shell scripts

== A library providing UI functions for shell scripts ==

When you write bash/shell scripts, do you write your own error/debug/logging/abort functions?
Logic that requests the user to input a boolean, string, password, selection out of a list,
date/time, integer, ... ?

Libui-sh is written to take care of all that.
libui-sh is meant to a be a general-purpose UI abstraction library for shell scripts.
Low impact, easy to use, but still flexible.
cli by default, can optionally use ncurses dialogs as well.

To start using it, you only need to source it and you can start calling its functions.
To reconfigure it (i.e. to change UI type, debug settings, logfile location),
just run the command libui_sh_init

example usage:

source /usr/lib/libui.sh
ask_yesno 'do you want to continue?' || return
libui_sh_init cli /tmp /tmp/yourlogfile
log 'we just got hassle-free logging'

The library is not strictly a UI library, it also contains a few useful functions like
check_is_in (check if an element can be found in a set - usually an array) and
seteditor (interactive $EDITOR selection)

Dependencies:
- bash (for cli interface)
- optionally: dialog (for ncurses interface)

https://github.com/Dieterbe/libui-sh

Comments

this would be a lot more useful if it was written in posix-compatible sh, rather than bash...

patch welcome.


Name:


E-mail:


URL:


Comment:


What is the first name of the guy blogging here?


This comment form is pretty crude. Make sure mandatory fields are entered correctly.
Basic html tags (a,i,b, etc) are allowed, others are sanitized