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

import typing
import pathlib
from styxdefs import *
import dataclasses

AFNI_OPEN_METADATA = Metadata(
    id="011cf64aad17ae870a6340e6c6714d18cd8c6e43.boutiques",
    name="afni_open",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class AfniOpenOutputs(typing.NamedTuple):
    """
    Output object returned when calling `afni_open(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def afni_open(
    files: list[InputPathType],
    method: str | None = None,
    editor: bool = False,
    downloader: bool = False,
    examinexmat: bool = False,
    browser: bool = False,
    readme: bool = False,
    afniweb: bool = False,
    global_help: bool = False,
    gopts_help: bool = False,
    help_: bool = False,
    mini_help: bool = False,
    extreme_help: bool = False,
    h_view: bool = False,
    h_web: bool = False,
    runner: Runner | None = None,
) -> AfniOpenOutputs:
    """
    A program to open various AFNI/SUMA files.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        files: Input file(s) to be opened.
        method: Method to open files (editor, downloader, browser, afni, suma,\
            1dplot, ExamineXmat, iviewer, afniweb, readme).
        editor: Same as -w editor.
        downloader: Same as -w downloader.
        examinexmat: Same as -w ExamineXmat.
        browser: Same as -w browser.
        readme: Same as -w readme.
        afniweb: Same as -w afniweb.
        global_help: Show help for global options.
        gopts_help: Show help for global options.
        help_: The entire help output.
        mini_help: Mini help.
        extreme_help: Extreme help.
        h_view: Open help in text editor.
        h_web: Open help in web browser.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `AfniOpenOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(AFNI_OPEN_METADATA)
    cargs = []
    cargs.append("afni_open")
    cargs.extend([execution.input_file(f) for f in files])
    if method is not None:
        cargs.extend([
            "-w",
            method
        ])
    if editor:
        cargs.append("-e")
    if downloader:
        cargs.append("-d")
    if examinexmat:
        cargs.append("-x")
    if browser:
        cargs.append("-b")
    if readme:
        cargs.append("-r")
    if afniweb:
        cargs.append("-aw")
    if global_help:
        cargs.append("-global_help")
    if gopts_help:
        cargs.append("-gopts_help")
    if help_:
        cargs.append("-help")
    if mini_help:
        cargs.append("-h")
    if extreme_help:
        cargs.append("-HELP")
    if h_view:
        cargs.append("-h_view")
    if h_web:
        cargs.append("-h_web")
    ret = AfniOpenOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "AFNI_OPEN_METADATA",
    "AfniOpenOutputs",
    "afni_open",
]
