dieterbe / libui-sh Goto Github PK
View Code? Open in Web Editor NEWa shell library providing useful UI functions
a shell library providing useful UI functions
== 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 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) It also comes with a shell color definitions file, just source libui-colors.sh to use them. Dependencies: - bash (for cli interface) - optionally: dialog (for ncurses interface)
Hello! I met a problem when sourcing the libui.sh. Here is the error:
../libui.sh: line 428: syntax error near unexpected token
<' ../libui.sh: line 428:
done < <(_dia_dialog --separate-output $elab --checklist "$str" 0 0 0 "${list[@]}")'
I found two locations with the code like '< <(_dia_dialog ...)', but don't known what's the meaning. In my opionion, it should be '< $(_dia_dialog ...)'. The following are the source code from libui.sh:
done < <(_dia_dialog --separate-output $elab --checklist "$str" 0 0 0 "${list[@]}")
done < <(_dia_dialog --form "$formtitle" 15 50 0 "${items[@]}")
Can anyone help me? Thanks!
foobar
I was building custom archiso and aif was not working correctly.
Welcome to Arch Linux Installation Framework
dirname: extra operand 'PROCEDURE'
Try 'dirname --help' for more information.
mkdir: missing operand
Try 'mkdir --help' for more information.
ERROR: Cannot create log directory
After debugging I found problem in libui.sh:
functions log() debug() and check_is_in()
Will priovide a patch for you
if you do something like:
#!/bin/bash -e
source libui.sh
echo $? # > 0
in libui_sh_init(), the shift 3
needs an || true
and the end of the function needs a return 0
to be explicit.
we probably need all code to be made compatible with set -e shells, even though that would make the code a bit more convoluted.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.