parse_cli_config Subroutine

public subroutine parse_cli_config(cfg)

Uses

  • proc~~parse_cli_config~~UsesGraph proc~parse_cli_config parse_cli_config module~watch_cmdsplice watch_cmdsplice proc~parse_cli_config->module~watch_cmdsplice

Parse CLI arguments and build the full watcher configuration.

Produces a watch_config_t: - cfg%w contains watcher options (polling, debounce, flags, etc.) - cfg%settings holds the typed fpm settings for the selected subcommand - cfg%fpm_cmdline is the effective command string - cfg%cmd_prefix and cfg%cmd_rest are helper fields used to inject target names into run/test commands.

Arguments

Type IntentOptional Attributes Name
type(watch_config_t), intent(out) :: cfg

Calls

proc~~parse_cli_config~~CallsGraph proc~parse_cli_config parse_cli_config proc~parse_cli parse_cli proc~parse_cli_config->proc~parse_cli proc~split_cmd_after_subcmd split_cmd_after_subcmd proc~parse_cli_config->proc~split_cmd_after_subcmd proc~add_features_csv add_features_csv proc~parse_cli->proc~add_features_csv proc~apply_watch_flag apply_watch_flag proc~parse_cli->proc~apply_watch_flag proc~apply_watch_from_manifest apply_watch_from_manifest proc~parse_cli->proc~apply_watch_from_manifest proc~default_build_dir default_build_dir proc~parse_cli->proc~default_build_dir proc~get_arg get_arg proc~parse_cli->proc~get_arg proc~init_build_settings init_build_settings proc~parse_cli->proc~init_build_settings proc~is_supported_subcmd is_supported_subcmd proc~parse_cli->proc~is_supported_subcmd proc~is_watch_flag is_watch_flag proc~parse_cli->proc~is_watch_flag proc~join_argv join_argv proc~parse_cli->proc~join_argv proc~normalize_watch_opts normalize_watch_opts proc~parse_cli->proc~normalize_watch_opts proc~push_feature push_feature proc~parse_cli->proc~push_feature proc~set_names set_names proc~parse_cli->proc~set_names proc~set_watch_defaults set_watch_defaults proc~parse_cli->proc~set_watch_defaults proc~usage_and_stop usage_and_stop proc~parse_cli->proc~usage_and_stop proc~usage_and_stop_ok usage_and_stop_ok proc~parse_cli->proc~usage_and_stop_ok proc~add_features_csv->proc~push_feature proc~apply_watch_flag->proc~get_arg proc~apply_watch_flag->proc~normalize_watch_opts proc~apply_watch_flag->proc~push_feature proc~apply_watch_flag->proc~usage_and_stop proc~apply_watch_flag->proc~usage_and_stop_ok proc~parse_int parse_int proc~apply_watch_flag->proc~parse_int proc~parse_real parse_real proc~apply_watch_flag->proc~parse_real proc~apply_watch_from_manifest->proc~normalize_watch_opts proc~load_watch_table load_watch_table proc~apply_watch_from_manifest->proc~load_watch_table proc~toml_get_int toml_get_int proc~apply_watch_from_manifest->proc~toml_get_int proc~toml_get_list_strings toml_get_list_strings proc~apply_watch_from_manifest->proc~toml_get_list_strings proc~toml_get_logical toml_get_logical proc~apply_watch_from_manifest->proc~toml_get_logical proc~toml_get_real toml_get_real proc~apply_watch_from_manifest->proc~toml_get_real features features proc~init_build_settings->features proc~join_argv->proc~get_arg proc~needs_quotes needs_quotes proc~join_argv->proc~needs_quotes proc~quote_arg quote_arg proc~join_argv->proc~quote_arg name name proc~set_names->name colorize colorize proc~usage_and_stop->colorize proc~usage_print_only usage_print_only proc~usage_and_stop->proc~usage_print_only proc~usage_and_stop_ok->proc~usage_print_only exists exists proc~load_watch_table->exists get_value get_value proc~load_watch_table->get_value read_package_file read_package_file proc~load_watch_table->read_package_file proc~is_windows_os is_windows_os proc~quote_arg->proc~is_windows_os proc~toml_get_int->get_value get_list get_list proc~toml_get_list_strings->get_list proc~toml_get_logical->get_value proc~toml_get_real->get_value proc~usage_print_only->colorize get_os_type get_os_type proc~is_windows_os->get_os_type

Source Code

   subroutine parse_cli_config(cfg)
      use watch_cmdsplice, only: split_cmd_after_subcmd
      type(watch_config_t), intent(out) :: cfg

      character(len=:), allocatable :: fpm_cmdline
      class(fpm_build_settings), allocatable :: settings
      character(len=:), allocatable :: subcmd

      call parse_cli(cfg%w, settings, fpm_cmdline, subcmd)

      cfg%fpm_cmdline = fpm_cmdline
      cfg%subcmd      = subcmd
      call move_alloc(settings, cfg%settings)

      call split_cmd_after_subcmd(cfg%fpm_cmdline, cfg%cmd_prefix, cfg%cmd_rest)
   end subroutine parse_cli_config