Command-line parsing and configuration assembly.
This module:
- Applies built-in defaults (set_watch_defaults),
- Applies project-level overrides from fpm.toml (apply_watch_from_manifest),
- Parses --watch-* options and fpm subcommand arguments,
- Produces a watch_config_t that drives the watcher engine.
Parsing is deliberately simple and "argv-token based": it does not implement
a full shell parser. The fpm_cmdline string is built for display and for
execution via execute_command_line / fpm_filesystem:run.
Return the default build directory used by fpm-watch.
Return whether a given subcommand token is supported by fpm-watch.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | s |
Detect whether an argv token is a watcher-specific flag.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | a |
Parse CLI arguments and build the full watcher configuration.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(watch_config_t), | intent(out) | :: | cfg |
Parse a comma-separated --features value into the features array.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(string_t), | intent(inout), | allocatable | :: | features(:) | ||
| character(len=*), | intent(in) | :: | csv |
Apply a single --watch-* flag to the watcher options.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | a | |||
| integer, | intent(inout) | :: | i | |||
| integer, | intent(in) | :: | narg | |||
| type(watch_opts_t), | intent(inout) | :: | w |
Populate settings with parsed values and environment fallbacks.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fpm_build_settings), | intent(inout) | :: | settings | |||
| character(len=*), | intent(in) | :: | build_dir | |||
| logical, | intent(in) | :: | prune | |||
| character(len=*), | intent(in) | :: | profile | |||
| type(string_t), | intent(in), | allocatable | :: | features(:) | ||
| character(len=*), | intent(in) | :: | compiler_in | |||
| character(len=*), | intent(in) | :: | c_compiler_in | |||
| character(len=*), | intent(in) | :: | cxx_compiler_in | |||
| character(len=*), | intent(in) | :: | archiver_in | |||
| character(len=*), | intent(in) | :: | flag_in | |||
| character(len=*), | intent(in) | :: | cflag_in | |||
| character(len=*), | intent(in) | :: | cxxflag_in | |||
| character(len=*), | intent(in) | :: | ldflag_in |
Parse the complete CLI and produce watcher options + typed fpm settings.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(watch_opts_t), | intent(out) | :: | w | |||
| class(fpm_build_settings), | intent(out), | allocatable | :: | settings | ||
| character(len=:), | intent(out), | allocatable | :: | fpm_cmdline | ||
| character(len=:), | intent(out), | allocatable | :: | subcmd |
Transfer collected name patterns into a run/test settings object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fpm_run_settings), | intent(inout) | :: | s | |||
| type(string_t), | intent(in), | allocatable | :: | names(:) |
Print a usage message and terminate with a non-zero exit status.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | msg |
Print a usage message and terminate successfully.