C Library Functions - set_mode (3)
NAME
set_mode(3f) - [ARGUMENTS:M_CLI2] turn on optional modes+
(LICENSE:PD)
CONTENTS
Synopsis
Description
Options
Examples
Author
License
SYNOPSIS
subroutine set_mode(key,mode)
character(len=*),intent(in) :: key
logical,intent(in),optional :: mode
DESCRIPTION
Allow optional behaviors.
OPTIONS
|
KEY |
name of option
|
|
The following values are allowed:
|
|
|
o
|
response_file - enable use of response file
|
|
o
|
auto_response_file - enable use of response file
but also act as if @$0 was entered on the command line
where $0 is the basename of the file being executed
|
|
o
|
ignorelongcase - ignore case in long key names. So the user
does not have to remember if the option is --CurtMode or --curtmode
or --curtMode .
|
|
o
|
ignoreallcase - ignore case in long and short key names.
This is similar to Powershell, which is case-insensitive.
|
|
o
|
dashunder - treat dash in keyword as an underscore.
So the user should not have to remember if the option is
--ignore_case or --ignore-case.
|
|
o
|
nodashunder - ignore dash and underscore in keywords.
|
|
o
|
strict - allow Boolean keys to be bundled, but requires
a single dash prefix be used for short key names and long names
must be prefixed with two dashes.
|
|
o
|
lastonly - when multiple keywords occur keep the rightmost
value specified instead of appending the values together.
|
|
MODE |
| |
set to .true. to activate the optional mode.
Set to .false. to deactivate the mode.
It is .true. by default.
|
|
EXAMPLES
Sample program:
program demo_set_mode
use M_CLI2, only : set_args, lget, set_mode
implicit none
character(len=*),parameter :: all=(*(g0))
!
! enable use of response files
call set_mode(response_file)
!
! Any dash in a keyword is treated as an underscore
call set_mode(underdash)
!
! The case of long keywords are ignored.
! Values and short names remain case-sensitive
call set_mode(ignorelongcase)
! The case of short and long keywords are ignored
call set_mode(ignoreallcase)
!
! short single-character boolean keys may be bundled
! but it is required that a single dash is used for
! short keys and a double dash for long keywords.
call set_mode(strict)
!
call set_args( --switch_X:X F --switch-Y:Y F --ox:O F -t F -x F -o F)
!
! show the results
print all,--switch_X or -X ... ,lget(switch_X)
print all,--switch_Y or -Y ... ,lget(switch_Y)
print all,--ox or -O ... ,lget(ox)
print all,-o ... ,lget(o)
print all,-x ... ,lget(x)
print all,-t ... ,lget(t)
end program demo_set_mode
AUTHOR
John S. Urban, 2019
LICENSE
Public Domain
| Nemo Release 3.1 | set_mode (3) | June 29, 2025 |
Generated by manServer 1.08 from 0a02989e-dc00-4013-9d67-e0a9ade8d771 using man macros.