Goddard-Fortran-Ecosystem / fArgParse

Licence: other
Command line argument parsing for Fortran

Programming Languages

fortran
972 projects
CMake
9771 projects
shell
77523 projects
NASL
115 projects

Projects that are alternatives of or similar to fArgParse

swift-commandlinekit
Framework supporting the development of command-line tools in Swift on macOS and Linux. The framework supports managing command-line arguments, provides lightweight functions to deal with escape sequences, and defines an API for reading strings from the terminal.
Stars: ✭ 38 (+123.53%)
Mutual labels:  command-line-arguments
olcut
A Java configuration, shell, and general utility toolkit
Stars: ✭ 23 (+35.29%)
Mutual labels:  command-line-arguments

Real documentation is sorely needed here.

Example: (from pFUnit)

 use fArgParse

 type(ArgParser), target :: parser
 type (StringUnlimitedMap) :: options
 logical :: debug

 ...
 
 parser = ArgParser()
 call parser%add_argument('-d', '-v', '--debug', '--verbose', action='store_true', &
      & help='make output more verbose')

 call parser%add_argument('-f', '--filter', action='store', &
      & help='only run tests that match pattern')
 
 call parser%add_argument('-o', '--output', action='store', &
      & help='only run tests that match pattern')

 call parser%add_argument('-r', '--runner', action='store', default='TestRunner', &
      & help='use non-default runner run tests')

 call parser%add_argument('-s', '--skip', type='integer', &
      & dest='n_skip', action='store', default=0, &
      & help='skip the first n_skip tests; only used with RemoteRunner')

 call parser%add_argument('-t', '--tap', type='string', &
      & dest='tap_file', action='store', default=0, &
      & help='add a TAP listener and send results to file name')

 ...
 option => options%at('debug')
 if (associated(option)) then
    call cast(option, debug)
    if (debug) call runner%add_listener(DebugListener(unit))
 end if

Buit in help:

./my_exe -h
 usage: ./tests/Vector/vector_tests [-h][-d][-f FILTER][-o OUTPUT][-r RUNNER][-s N_SKIP][-t TAP_FILE]
  
 optional arguments:
  -h, --help                 This message.
  -d, --debug, --verbose     make output more verbose
  -f, --filter               only run tests that match pattern
  -o, --output               only run tests that match pattern
  -r, --runner               use non-default runner run tests
  -s, --skip                 skip the first n_skip tests; only used with RemoteRunner
  -t, --tap                  add a TAP listener and send results to file name
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].