Skip to content

Commit

Permalink
Fixed the broken env variables help message.
Browse files Browse the repository at this point in the history
Fixes: #79
  • Loading branch information
matejak committed May 11, 2019
1 parent d37552c commit daae63a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 9 deletions.
10 changes: 9 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
2.8.0 (2019-01-26)
2.8.1 (TBA)
-----------

Bugfixes:

* The environment variables help message has been fixed (#79).


2.8.0 (2019-01-26)
------------------

New features:

* Allow argbash and argbash-init to be run from symbolic links.
Expand Down
28 changes: 22 additions & 6 deletions src/stuff.m4
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,29 @@ m4_define([_MAKE_HELP_FUNCTION_OPTIONAL_PART], [m4_lists_foreach_optional(
)])])
dnl
dnl $1: list name
dnl $2: name
dnl $3: default
dnl $4: help
m4_define([_MAKE_ENV_HELP_MESSAGE], [m4_do(
[m4_ifnblank([$4], [m4_list_append([$1], m4_do(
[[$2: $4.]],
[m4_ifnblank([$3], [[ (default: '$3']]))],
))])],
)])
dnl
dnl $1: The name of list for help messages
m4_define([_MAKE_ENV_HELP_MESSAGES], [m4_do(
[m4_lists_foreach([ENV_NAMES,ENV_DEFAULTS,ENV_HELPS], [_name,_default,_help],
[_MAKE_ENV_HELP_MESSAGE([$1], _name, _default, _help)])],
)])
m4_define([_MAKE_HELP_FUNCTION_ENVVARS_PART], [m4_do(
[m4_lists_foreach([ENV_NAMES,ENV_DEFAULTS,ENV_HELPS], [_name,_default,_help], [m4_do(
[m4_ifnblank(_help, [m4_list_append([LIST_ENV_HELP], m4_expand([m4_do(
[m4_expand([_name: _help.])],
[m4_ifnblank(_default, [ (default: ']_default'))],
)]))])],
)])],
[_MAKE_ENV_HELP_MESSAGES([LIST_ENV_HELP])],
[printf '\nEnvironment variables that are supported:\n'
],
[m4_list_foreach([LIST_ENV_HELP], [_msg], [printf '\t%s\n' "[]_msg"
Expand Down
4 changes: 2 additions & 2 deletions start_tmux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ tmux new-session -d -s argbash
tmux send-keys 'cd src' C-m
tmux send-keys 'vim stuff.m4' C-m
tmux new-window -c resources
tmux send-keys -l 'make check'
tmux new-window -c tests/regressiontests
tmux send-keys -l 'make unittests'
tmux new-window -c tests/unittests
tmux send-keys -l 'vim '
tmux select-window -t argbash:0
tmux -2 attach-session -t argbash

0 comments on commit daae63a

Please sign in to comment.