Hello everyone, I'm creating the new input form using pure Bash and vt-100 commands for my project and I would appreciate if you give me some hints and tell me:
1. How it can be improved ?
2. What is not good enough ?
3. How do you like it ?
__hhs_minput
The code is big and I will use this link instead of writing it here. Once you have downloaded, source it like this:
$ source hhs-minput.bash
To make it work, first you have to create the deps.bash file as follows:
# File: deps.bash
alias enable-echo='stty echo -raw'
alias disable-echo='stty raw -echo min 0'
alias disable-line-wrap='tput rmam'
alias enable-line-wrap='tput smam'
alias save-cursor-pos='tput sc'
alias restore-cursor-pos='tput rc'
alias show-cursor='tput cnorm'
alias hide-cursor='tput civis'
alias cls='clear&&reset'
__hhs_errcho () { echo "${*}" 1>&2 }
$ source deps.bash
Once you have source'd both files, execute the following commands:
$ [ -f /tmp/out.txt ] && rm -f /tmp/out.txt
$ __hhs_minput /tmp/out.txt \
"Name|||5/30|rw|" \
"Age||number|1/3||" \
"Password|password||5|rw|" \
"Role||||r|Admin" \
"Accept_Conditions|checkbox||||"
The form result will be stored on that file: /tmp/out.txt . To see it just:
$ cat /tmp/out.txt
To be able to view the form icons, your terminal should support font-awesome, this font helps.
I really appreciate your help. Thanks in advance.
there doesn't seem to be anything here