watch_cmdsplice Module

Helpers for manipulating fpm command lines.

Provides utilities to split an fpm <subcmd> ... command into a prefix and remainder, and to inject target names into the correct position while preserving a -- delimiter for arguments passed to the executed program.

These utilities operate on plain strings and assume a space-delimited token structure. They do not implement general shell parsing.


Used by

  • module~~watch_cmdsplice~~UsedByGraph module~watch_cmdsplice watch_cmdsplice proc~build_run_command build_run_command proc~build_run_command->module~watch_cmdsplice proc~parse_cli_config parse_cli_config proc~parse_cli_config->module~watch_cmdsplice

Functions

public function inject_names_into_cmd(prefix, rest, names) result(out)

Inject target names into a command line while respecting a -- delimiter.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix

Prefix up to and including the subcommand.

character(len=*), intent(in) :: rest

Remaining arguments after the subcommand.

character(len=*), intent(in) :: names

Space-separated names to inject.

Return Value character(len=:), allocatable


Subroutines

public subroutine split_cmd_after_subcmd(full, prefix, rest)

Split a command line into <fpm subcmd> prefix and remaining arguments.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: full

Full command string.

character(len=:), intent(out), allocatable :: prefix

Prefix up to and including the subcommand token.

character(len=:), intent(out), allocatable :: rest

Remaining arguments after the subcommand.