set_mode(3m_cli2)
π set_mode β the m_cli2 manual, section 3f, bestie π
okay so real quick, this page lives in the m_cli2 manual (section 3f, Fortran vibes only obviously) and its whole name is set_mode(3f) β it's filed under [ARGUMENTS:M_CLI2] and it's licensed PD. Yes, Public Domain, we love a generous queen. π
β¨ NAME β¨
set_mode(3f) β [ARGUMENTS:M_CLI2] turn on optional modes (LICENSE:PD)
it's literally the "hey can we make this behave differently" switch. that's the whole job. π
π¦ SYNOPSIS π¦
subroutine set_mode(key,mode)
character(len=*),intent(in) :: key
logical,intent(in),optional :: mode
so you hand it a key, and maybe a mode if you're feeling fancy. π
πΈ DESCRIPTION πΈ
Allow optional behaviors.
that's it. that's the description. it lets you turn optional behaviors on. no cap. π«Ά
π OPTIONS π
- KEY β name of option
The following values are allowed:
response_fileβ enable use of response file πignorecaseβ ignore case in long key names. So the user does not have to remember if the option is--IgnoreCaseor--ignorecaseor--ignoreCase. like bestie, we are NOT memorizing your capitalization scheme, be serious. πunderdashβ treat dash in keyword as an underscore. So the user should not have to remember if the option is--ignore_caseor--ignore-case. both. both is good. β¨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. so like,-t-x-ocan squad up together, but long names gotta come correct with the--. no shortcuts, periodt. πlastonlyβ when multiple keywords occur keep the rightmost value specified instead of appending the values together. so the last one wins instead of everyone holding hands. π- MODE β set to
.true.to activate the optional mode. Set to.false.to deactivate the mode. It is.true.by default. so if you don't say anything, it's already on. main character default energy. π
π EXAMPLE π
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('ignorecase')
!
! 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')
!
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
look at that little demo go. it's giving competence. π₯ (and yes, ignorecase only vibes with long keywords β values and short names stay case-sensitive, that's not a bug that's the plot.)
π AUTHOR π
John S. Urban, 2019. king behavior, honestly. π«‘
π LICENSE π
Public Domain
fr fr, take it, it's yours, no strings. π
and that's the whole page bestie!! πΈ this little diva is from the m_cli2 manual, source/version line says set_mode(3m_cli2) and the date on it is February 10, 2023 β so if you're citing it in your homework, that's your citation, iykyk. πβ¨π
π¦ where this page comes from
- ubuntu resolute: libfortran-cli2-dev 3.2.0-6 Β· UNLICENSE
- ubuntu stonking: libfortran-cli2-dev 3.2.0-13 Β· UNLICENSE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms