A framework for creating a Bash CLI application.
MIT License
Full Changelog: https://github.com/unfor19/bargs/compare/v.1.1.4...v1.1.5
Published by unfor19 about 3 years ago
Published by unfor19 almost 4 years ago
Fixed breaking hidden prompts with CTRL+C
Prettier example.sh
, making it more readable
Fixed getting the proper env var if already exists, for example, the following caused age
to be empty
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1 # agent contains "age"
...
age=33
Published by unfor19 about 4 years ago
Published by unfor19 about 4 years ago
example.sh --name "Willy Wonka"
example.sh --name="Willy Wonka"
Published by unfor19 about 4 years ago
bargs_vars
file by setting the environment variable BARGS_VARS_PATH
In your application example.sh
export BARGS_VARS_PATH="$bargs_vars_path"
source "${PWD}"/"$(dirname ${BASH_SOURCE[0]})"/bargs.sh "$@"
This feature enables having a single bargs.sh
file, with multiple bargs_vars
in the same repository. It's now possible to embed bargs in multiple Bash scripts that reside in the same repository.
Version bumped from v1.0.14
to v1.1.0
🎉
Published by unfor19 about 4 years ago
Published by unfor19 about 4 years ago
allow_env_var=true
Published by unfor19 about 4 years ago
Published by unfor19 about 4 years ago
Published by unfor19 about 4 years ago
flag=true
, when using it, the value of the argument will be set to true
Published by unfor19 about 4 years ago
allow_empty=true
prompt=true
, hidden=true
and confirmation=true
Published by unfor19 about 4 years ago
Minor updates in pipeline
Published by unfor19 about 4 years ago
person_name
is also available as PERSON_NAME
update_testresults.sh
script which updates the README.md file according to the results of tests.sh
Published by unfor19 about 4 years ago
default
definitions in bargs_vargs
; updated the docs and examples accordinglyPublished by unfor19 over 4 years ago
bargs_vars
is in the same folder as bargs.sh
Published by unfor19 over 4 years ago
tests.sh
- Function log_msg
to avoid hardcoding the messagetests.sh
- Test for help message flag -h
bargs.sh
- Removed the exit
command from usage
function; makes it possible to be used in the -h
casebargs.sh - Unknown Argument printed
[ERROR] [ERROR]instead of printing
[ERROR]` oncePublished by unfor19 over 4 years ago
You can now define options
, the values of options
must be separated with a whitespace
bargs_vars
snippet
---
name=gender
short=g
description='male or female?'
options=male female
---
Published by unfor19 over 4 years ago
Again, thanks to the community feedback, removed the use of eval
when it's not absolutely necessary.
Published by unfor19 over 4 years ago
As part of the community feedback, you can now use quotes, "
and '
in the bargs_vars
file.
Even though it's not really necessary, it can lead to weird behavior to add quotes prior to this release.