2026-07-18 18:48:23 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
//#include <filesystem>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
#include "file.h"
|
2026-08-16 01:37:59 +02:00
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
|
|
class Machine;
|
2026-07-18 18:48:23 +02:00
|
|
|
|
|
|
|
|
void set_verbose_level(int argc, char* argv[]);
|
|
|
|
|
bool show_usage(int argc, char* argv[]);
|
|
|
|
|
|
|
|
|
|
fs::path construct_command_pathname(char* command);
|
|
|
|
|
|
|
|
|
|
std::tuple<std::string, std::string, std::string, std::string, bool, bool>
|
|
|
|
|
parse_args(
|
|
|
|
|
const std::vector<std::string>& input_filenames, std::string target,
|
|
|
|
|
std::string output_basename, bool display_only);
|
2026-08-16 01:37:59 +02:00
|
|
|
|
|
|
|
|
void load_klammersets(Machine& machine, const strings_t& symbols);
|
2026-09-08 16:54:21 +02:00
|
|
|
|
|
|
|
|
// The state a command gives a Machine before anything is read: the frame
|
|
|
|
|
// named for the command and the K_* variables that describe the run --
|
|
|
|
|
// target, output directory and basename, whether output is displayed rather
|
|
|
|
|
// than written, the input filenames, the verbosity, and the input directory
|
|
|
|
|
// (the first input file's, or the cwd when there is none). This was the top
|
|
|
|
|
// of ktext's main(), and it is policy, not mechanism: a klammer set reads
|
|
|
|
|
// these names (@document reads K_stdout_only and K_output_dir), so a second
|
|
|
|
|
// consumer of the Machine -- the Python binding in kpy/ -- must set exactly
|
|
|
|
|
// the same ones or a document that renders under ktext fails under it. One
|
|
|
|
|
// function, two callers, nothing restated.
|
|
|
|
|
void set_command_state(
|
|
|
|
|
Machine& machine, const std::string& frame_name, const std::string& target,
|
|
|
|
|
const std::vector<std::string>& input_filenames, const std::string& output_dir,
|
|
|
|
|
const std::string& output_basename, bool display_only);
|