pub fn safe_output_path(
base_dir: &Path,
name: &str,
extension: &str,
) -> CliResult<PathBuf>Expand description
Validates and sanitizes a filename, then constructs a safe output path.
This is a convenience function that combines sanitize_filename and
validate_output_path with automatic .json extension.
§Security
This function performs all necessary security validations.
§Arguments
base_dir- The base directory for output filesname- The filename to sanitize (e.g., tool name)extension- The file extension to add (e.g., “json”)
§Returns
A validated, safe output path.