"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/list.m4" between
argbash-2.9.0.tar.gz and argbash-2.10.0.tar.gz

About: argbash is a bash code generator that can assist you in writing scripts that accept arguments.

list.m4  (argbash-2.9.0):list.m4  (argbash-2.10.0)
skipping to change at line 138 skipping to change at line 138
[m4_if(m4_cmp(listlen - 1, 0), 1, [m4_if(m4_cmp(listlen - 1, 0), 1,
[[$3]m4_list_nth([$1], m4_decr(listlen))[$4]m4_default([$5], [$2] )], [[$3]m4_list_nth([$1], m4_decr(listlen))[$4]m4_default([$5], [$2] )],
)], )],
[m4_if(m4_cmp(listlen - 0, 0), 1, [m4_if(m4_cmp(listlen - 0, 0), 1,
[[$3]m4_list_nth([$1], listlen)[$4]], [[$3]m4_list_nth([$1], listlen)[$4]],
)], )],
[m4_popdef([listlen])], [m4_popdef([listlen])],
)]) )])
dnl dnl
dnl $1: list name
dnl $2: last join (separator by default)
dnl $3: quote ("'" by default)
dnl $4: separator (", " by default)
m4_define([m4_list_format_sequence], [m4_do(
[m4_pushdef([_quote], m4_dquote(m4_default_quoted([$3], ['])))],
[m4_pushdef([_sep], m4_dquote(m4_default_quoted([$4], [, ])))],
[m4_list_join([$1], _sep, _quote, _quote, m4_dquote(m4_default_quoted([$2
], _sep)))],
[m4_popdef([_sep])],
[m4_popdef([_quote])],
)])
dnl
dnl Returns its n-th element, first item has index of 1. dnl Returns its n-th element, first item has index of 1.
dnl If the element index is wrong, return $3 dnl If the element index is wrong, return $3
m4_define([m4_list_nth], [m4_do( m4_define([m4_list_nth], [m4_do(
[m4_bmatch([$2], [[1-9][0-9]*], [m4_do( [m4_bmatch([$2], [[1-9][0-9]*], [m4_do(
[m4_pushdef([_listlen], m4_list_len([$1]))], [m4_pushdef([_listlen], m4_list_len([$1]))],
[m4_if(m4_cmp([$2], _listlen), 1, [m4_ifnblank([$3], [$3], [m4_fa tal([The list '$1' has length of ]_listlen[, so element No. $2 is not available] )])])], [m4_if(m4_cmp([$2], _listlen), 1, [m4_ifnblank([$3], [$3], [m4_fa tal([The list '$1' has length of ]_listlen[, so element No. $2 is not available] )])])],
[m4_popdef([_listlen])], [m4_popdef([_listlen])],
[m4_expand(m4_argn([$2], m4_list_contents([$1])))], [m4_expand(m4_argn([$2], m4_list_contents([$1])))],
)], [m4_ifnblank([$3], [$3], [m4_fatal([Requesting element $2 from list ' $1': Only positive indices are available])])])], )], [m4_ifnblank([$3], [$3], [m4_fatal([Requesting element $2 from list ' $1': Only positive indices are available])])])],
)]) )])
 End of changes. 1 change blocks. 
0 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)