Skip to content

CLI Method set_mutually_exclusive_groups

Stefano Zaghi edited this page Mar 23, 2016 · 2 revisions

set_mutually_exclusive_groups

Signature

call cli%set_mutually_exclusive_groups(group1, group2)
Meaning

Set two groups of CLAs (two command) as mutually-exclusive, i.e. if one is invoked the other cannot and viceversa. All dummy arguments are required.

Dummy arguments
character(*), intent(in) :: group1 !< Name of the first grouped CLAs.
character(*), intent(in) :: group2 !< Name of the second grouped CLAs.

Note that the two groups (commands) must be defined previously the invocation of this method.

Usage

Must be used for setting two groups of CLAs (two commands ) as mutually-exclusive

use flap

type(command_line_interface):: cli

! define CLI
call cli%init(...)
! define two groups (with direct or direct methods)
call cli%add_group(group='commit', ...)
call cli%add(group='init', ...)

call cli%set_mutually_exclusive_groups(group1='commit', group2='init')

Now, it the CLI is invoked with both commit and init a (clear) error message is printed to stderr.

Clone this wiki locally