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

Leftover args bug #8

Closed
matejak opened this issue Apr 20, 2017 · 3 comments
Closed

Leftover args bug #8

matejak opened this issue Apr 20, 2017 · 3 comments

Comments

@matejak
Copy link
Owner

matejak commented Apr 20, 2017

Argbash 2.4.0 fails on the following input:

#!/bin/bash
#
# This is a rather minimal example Argbash potential
# Example taken from http://argbash.readthedocs.io/en/stable/example.html
#
# ARG_POSITIONAL_SINGLE([command], [c], [optional argument help msg])
# ARG_OPTIONAL_BOOLEAN([verbose], , [if set, output will be verbose])

# ARG_VERSION([echo $0 v$VERSION])
# ARG_HELP([The general script's help msg])

# ARG_LEFTOVERS([define 1 or more input file; if ommited scripts can still act on different values of SLRUM_PROCID])
# ARGBASH_GO 

producing a false alarm about unknown number of positional args before defining leftover arguments.

@matejak matejak added the bug label Apr 20, 2017
@cmeesters
Copy link

Hi Matěj,

Just for your information: Any(!) placement of ARG_POSITIONAL_X instead of ARG_LEFTOVERS essentially triggers the same alarm ("... This is not supported, define arguments
that accept fixed number of values first.").

Cheers
Christian

@matejak
Copy link
Owner Author

matejak commented Apr 21, 2017

I see now that this is not strictly an Argbash bug - the
ARG_POSITIONAL_SINGLE([command], [c], [optional argument help msg])
has help "c" and default value "optional argument help msg". You probably want to make command optional, or remove the [c] argument - see http://argbash.readthedocs.io/en/stable/guide.html#positional-arguments.
However, I can see that the error message could be more helpful, so I will close the issue when it is improved.

@matejak matejak added enhancement and removed bug labels Apr 21, 2017
@matejak
Copy link
Owner Author

matejak commented Apr 21, 2017

The git master now gives a better feedback:
error: The number of expected positional arguments before 'leftovers' is unknown (because of argument 'command', which has a default). This is not supported, define arguments that accept fixed number of values first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants