From a4c8409944b686f214c79c299831839589b559c5 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 30 Aug 2025 12:16:57 -0400 Subject: Update docs --- docs/tomo.1.md | 60 ++++++++++++++++++++++++++++++++++++++-------------------- src/tomo.c | 15 ++++++++++++++- 2 files changed, 53 insertions(+), 22 deletions(-) diff --git a/docs/tomo.1.md b/docs/tomo.1.md index 3bf5e779..6fefad69 100644 --- a/docs/tomo.1.md +++ b/docs/tomo.1.md @@ -32,41 +32,59 @@ C code, which is then compiled using a C compiler of your choice. # OPTIONS -`-h`, `--help` -: Print the usage and exit. +`--changelog` +: Print the compiler change log and exit. -`-t`, `--transpile` -: Transpile the input files to C code without compiling them. +`--compile-exe`, `-e` +: Compile the input file to an executable. -`-c`, `--compile-obj` +`--compile-obj`, `-c` : Compile the input files to static objects, rather than running them. -`-e`, `--compile-exe` -: Compile the input file to an executable. - -`-L`, `--library` -: Compile the input files to a shared library file and header. +`--help`, `-h` +: Print the usage and exit. -`-I`, `--install` +`--install`, `-I` : Install the compiled executable or library. -`-C` **, `--show-codegen` ** +`--library`, `-L` +: Compile the input files to a shared library file and header. + +`--show-codegen` **, `-C` ** : Set a program (e.g. `cat` or `bat`) to display the generated code -`-O` **level**, `--optimization` **level** -: Set the optimization level. +`--force-rebuild`, `-f` +: Force rebuilding/recompiling. -`-v`, `--verbose` -: Print extra verbose output. +`--format` +: Autoformat a file and print it to standard output. -`--version` -: Print the compiler version and exit. +`--format-inplace` +: Autoformat a file in-place. -`--changelog` -: Print the compiler change log and exit. +`--optimization` **level**, `-O` **level** +: Set the optimization level. `--prefix` : Print the Tomo installation prefix and exit. -`-r`, `--run` +`--quiet`, `-q` +: Run in quiet mode. + +`--run`, `-r` : Run an installed tomo program from `~/.local/share/tomo_vX.Y/installed`. + +`--source-mapping=`, `-m=` **** +: Toggle whether source mapping should be enabled or disabled. + +`--transpile`, `-t` +: Transpile the input files to C code without compiling them. + +`--uninstall`, `-u` +: Uninstall a compiled executable or library. + +`--verbose`, `-v` +: Print extra verbose output. + +`--version` +: Print the compiler version and exit. diff --git a/src/tomo.c b/src/tomo.c index a8bba555..7c4b556c 100644 --- a/src/tomo.c +++ b/src/tomo.c @@ -180,10 +180,22 @@ int main(int argc, char *argv[]) { "\x1b[1mUninstall libraries:\x1b[m tomo -u lib...\n" "\x1b[1mOther flags:\x1b[m\n" " --verbose|-v: verbose output\n" + " --prefix: print the Tomo prefix directory\n" " --quiet|-q: quiet output\n" " --parse|-p: show parse tree\n" + " --transpile|-t: transpile C code without compiling\n" + " --show-codegen|-c : show generated code\n" + " --compile-obj|-c: compile C code for object file\n" + " --compile-exe|-e: compile to standalone executable without running\n" + " --format: print formatted code\n" + " --format-inplace: format the code in a file (in place)\n" + " --library|-L: build a folder as a library\n" " --install|-I: install the executable or library\n" + " --uninstall|-u: uninstall an executable or library\n" " --optimization|-O : set optimization level\n" + " --force-rebuild|-f: force rebuilding\n" + " --source-mapping|-m : toggle source mapping in generated code\n" + " --changelog: show the Tomo changelog\n" " --run|-r: run a program from " TOMO_PREFIX "/share/tomo_" TOMO_VERSION "/installed\n"); Text_t help = Texts(Text("\x1b[1mtomo\x1b[m: a compiler for the Tomo programming language"), Text("\n\n"), usage); tomo_parse_args(argc, argv, usage, help, TOMO_VERSION, // @@ -215,7 +227,8 @@ int main(int argc, char *argv[]) { {"I", false, &Bool$info, &should_install}, // {"optimization", false, &Text$info, &optimization}, // {"O", false, &Text$info, &optimization}, // - {"force-rebuild", false, &Bool$info, &clean_build}, {"f", false, &Bool$info, &clean_build}, // + {"force-rebuild", false, &Bool$info, &clean_build}, // + {"f", false, &Bool$info, &clean_build}, // {"source-mapping", false, &Bool$info, &source_mapping}, {"m", false, &Bool$info, &source_mapping}, // {"changelog", false, &Bool$info, &show_changelog}, ); -- cgit v1.2.3