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

act argument in add( ) subroutine #68

Closed
wadudmiah opened this issue Oct 2, 2016 · 3 comments
Closed

act argument in add( ) subroutine #68

wadudmiah opened this issue Oct 2, 2016 · 3 comments

Comments

@wadudmiah
Copy link

Hello,

In your example code, there is an actual argument called "act" with a value "store":

call cli%add(switch='--string', &
switch_ab='-s', &
help='a string', &
required=.true., &
act='store', &
error=error)

What exactly is this argument for and what the possible values and their meanings?

Thanks in advance,
Wadud.

@szaghi
Copy link
Owner

szaghi commented Oct 2, 2016

@wadudmiah Hi, I am not sure to follow your question.

The argument act is used to select the kind of CLA you are defining, e.g.:

  • act='storemeans to store the value pased after the switch name, e.g.-s hellowill store the stringhello`;
  • act='store_true' means that the switch doesn't require a value, but if passed the value .true. is automatically stored, e.g. -save could be an invocation of a switch to activate the saving of a file.

For more details about the definition of CLA refer to the wiki https://github.com/szaghi/FLAP/wiki/CLI-Method-add

Let me know if this help, or give me more details.

See you soon.

@szaghi
Copy link
Owner

szaghi commented Oct 2, 2016

Moreover, the value stored can be of any kind: it is parsed as a string and returned on your demand with the type and kind you want, e.g. -i 65 will store 65 as a string, but with %get method you will obtain an integer, if you want.

@wadudmiah
Copy link
Author

@szaghi thanks for your help on this! much appreciated.

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

No branches or pull requests

2 participants