# This file was auto generated by Styx.
# Do not edit this file directly.

import typing
import pathlib
from styxdefs import *
import dataclasses

V__SUMA_REPREFIXIZE_SPEC_METADATA = Metadata(
    id="19385e693af8f09dac5faa2aadd037a6f25c79e7.boutiques",
    name="@suma_reprefixize_spec",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class VSumaReprefixizeSpecOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v__suma_reprefixize_spec(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    prefixed_spec_files: OutputPathType
    """Prefixed SUMA specification files"""


def v__suma_reprefixize_spec(
    input_file: InputPathType,
    prefix: str,
    output_dir: str,
    work_dir: str,
    no_clean: bool = False,
    runner: Runner | None = None,
) -> VSumaReprefixizeSpecOutputs:
    """
    A tool for prefixing and working with SUMA specification files.
    
    Author: AFNI Team
    
    URL:
    https://afni.nimh.nih.gov/pub/dist/doc/program_help/@suma_reprefixize_spec.html
    
    Args:
        input_file: Input SUMA specification file.
        prefix: Prefix to be added to the file names.
        output_dir: Output directory where the prefixed files will be saved.
        work_dir: Working directory for temporary files.
        no_clean: Flag to avoid cleaning temporary files.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VSumaReprefixizeSpecOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__SUMA_REPREFIXIZE_SPEC_METADATA)
    cargs = []
    cargs.append("suma_reprefixize_spec")
    cargs.extend([
        "-input",
        execution.input_file(input_file)
    ])
    cargs.extend([
        "-preprefix",
        prefix
    ])
    cargs.extend([
        "-odir",
        output_dir
    ])
    cargs.extend([
        "-workdir",
        work_dir
    ])
    if no_clean:
        cargs.append("-no_clean")
    ret = VSumaReprefixizeSpecOutputs(
        root=execution.output_file("."),
        prefixed_spec_files=execution.output_file(output_dir + "/*.spec"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VSumaReprefixizeSpecOutputs",
    "V__SUMA_REPREFIXIZE_SPEC_METADATA",
    "v__suma_reprefixize_spec",
]
