llm
Download
27 lines 1.1 KiBCModified 2026-09-28 raw
123456789101112131415161718192021222324252627
// The tomo CLI's subcommands, one per src/cmd/*.c file

#pragma once

#include "../stdlib/cli.h"
#include "../stdlib/datatypes.h"

extern cli_command_t run_command, build_command, transpile_command, parse_command, format_command, package_command,
    uninstall_command, vendor_command, info_command, source_command, version_command, eval_command, test_command;

// The tomo CLI itself (defined in tomo.c); its usage/help text is
// autogenerated during dispatch:
extern cli_spec_t tomo_cli;

// `tomo`'s main handler: runs when the first word isn't a command name
// (bare `tomo file.tm`, `tomo` with no arguments).
int tomo_main(cli_command_t *self, List_t extra_args);

// Applies the CLI palette to `run`'s hand-written usage/description text.
// Must run after tomo_init() has decided whether output is colored.
void style_run_command(void);

// Compile the .tm file at `path` and exec it (shared by `tomo run` and
// `tomo eval`). With `print_values`, the program prints what each of its
// top-level statements evaluates to, which is what `tomo eval` shows. Defined
// in run.c:
int compile_and_exec(Path_t path, List_t extra_args, bool print_values);