convert_paths_to_basenames

convert_paths_to_basenames(command_string: str) str[source]

Convert all absolute and relative file paths in command string to basenames.

Handles multi-line strings with comments and preserves all formatting while converting only the file paths to basenames. Ensures proper quote pair matching and excludes strings with ANY nested quotes (both same and different types).

Parameters:

command_string -- CASA command string(s) with file paths to convert.

Returns:

Command string with all paths converted to basenames only.