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

Add CLA sectioning for better help message of long list of CLAs #74

Open
szaghi opened this issue Feb 3, 2017 · 0 comments
Open

Add CLA sectioning for better help message of long list of CLAs #74

szaghi opened this issue Feb 3, 2017 · 0 comments
Assignees

Comments

@szaghi
Copy link
Owner

szaghi commented Feb 3, 2017

For CLI having a long list of CLAs it could be helpful to section CLAs in families of CLAs, e.g. files-section, dirs-section, input-section...

Something similar to argparse groups that is different from FLAP groups that are, indeed, argparse subcommands.

Example

type(command_line_interface) :: cli

call cli%init
call cli%add(switch='--grid_file', &
             switch_ab='-g',    &
             help='Grid file name',   &
             required=.true.,   &
             act='store',       &
             section='files', &
             error=error)
call cli%add(switch='--sol_file', &
             switch_ab='-s',    &
             help='Solution file name',   &
             required=.true.,   &
             act='store',       &
             section='files', &
             error=error)
call cli%add(switch='--sim_dir', &
             switch_ab='-g',    &
             help='Simulation directory path',   &
             required=.true.,   &
             act='store',       &
             section='directories', &
             error=error)

That should generate something like

usage...

files:
  --grid_file Grid file
...
directories
  --sim_dir Simulation directory path
@szaghi szaghi self-assigned this Feb 3, 2017
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

1 participant