Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent indentation with validators #143

Open
matejak opened this issue Nov 25, 2020 · 0 comments
Open

Inconsistent indentation with validators #143

matejak opened this issue Nov 25, 2020 · 0 comments
Labels
Milestone

Comments

@matejak
Copy link
Owner

matejak commented Nov 25, 2020

When validation functions such as 'pint()' are placed into the resulting shell script they do not include the same indentation specified using ARGBASH_SET_INDENT([ ]) instead the hard tabs remain and the rest of the script has the four spaces.

I can see that the problem is the lack of _INDENT_() or _JOIN_INDENTED() macros within value_validators.m4 file. I tried to get indentation to occur within the following macro so that all validators are covered, including those created as a result of using ARG_TYPE_GROUP_SET():

dnl
dnl Put definitions of validating functions if they are needed
m4_define([_PUT_VALIDATORS], [m4_do(
        [m4_set_empty([VALUE_TYPES_USED], , [m4_n([# validators])])],
        [m4_set_foreach([VALUE_TYPES], [_val_type], [m4_do(
                [m4_set_empty(m4_expand([[VALUE_GROUP_]_val_type]), ,
                        m4_expand([_ENDL_()[_validator_]_val_type[]_ENDL_(2)]))],
        )])],
)])

I had hoped that I could send you a simple diff-patch with an elegant fix, unfortunately I have no M4 scripting knowledge and despite spending time looking at other parts of the code as a guide and after numerous attempts I still could not get the results that I wanted using m4.

@matejak matejak added the bug label Nov 25, 2020
@matejak matejak added this to the 2.11.0 milestone Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant