summaryrefslogtreecommitdiff
path: root/src/bin/tq.rs
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2025-10-13 10:01:05 +1300
committerBen Bridle <ben@derelict.engineering>2025-10-13 10:01:05 +1300
commite2a04d00ce7d989335cd678213d90134fefe0b0f (patch)
treecd6747bd65ef20005f4b114f0a41c3e1bf35d2f4 /src/bin/tq.rs
parent3fe1a4f983904340d8bac580164b3862376d7acf (diff)
downloadtorque-asm-e2a04d00ce7d989335cd678213d90134fefe0b0f.zip
Update help text
Diffstat (limited to 'src/bin/tq.rs')
-rw-r--r--src/bin/tq.rs44
1 files changed, 25 insertions, 19 deletions
diff --git a/src/bin/tq.rs b/src/bin/tq.rs
index a41aba9..9ac2587 100644
--- a/src/bin/tq.rs
+++ b/src/bin/tq.rs
@@ -50,32 +50,40 @@ fn main() {
eprintln!("\
Usage: tq [source] [destination]
-Torque multi-assembler, see http://benbridle.com/torque for documentation.
+Torque is a lightweight meta-assembler (see http://benbridle.com/torque).
+
+Usage:
+ To assemble a Torque program from a source file and write to an output
+ file, run `tq [source] [destination]`, where [source] is the path
+ of the source file and [destination] is the path to write to.
+
+ If [destination] is omitted, the assembled program will be written to
+ standard output. If [source] is omitted, the program source code will
+ be read from standard input.
+
+Environment variables:
+ TORQUE_LIBS
+ A list of colon-separated paths that will be searched to find Torque
+ source code files to use as libraries when assembling a Torque program.
+ If a library file resolves an unresolved symbol in the program being
+ assembled, the library file will be merged into the program.
Arguments:
- [source] Path to a source file to assemble
- [destination] Path to which output will be written
+ [source] Torque source code file to assemble
+ [destination] Destination path for assembler output
Switches:
- --extension=<ext> File extension to identify library files (default is 'tq')
- --format=<fmt> Format to apply to assembled bytecode (default is 'debug')
+ --dry-run (-n) Assemble and show errors only, don't write any output
+ --extension=<ext> File extension to identify source files (default is 'tq')
+ --format=<fmt> Output format to use for assembled program (default is 'debug')
--width=<width> Force a fixed width for all assembled words
--no-project-libs Don't search for libraries in the source parent folder
--no-env-libs Don't search for libraries in the TORQUE_LIBS path variable
--no-libs Combination of --no-project-libs and --no-env-libs
- --tree Display a tree visualisation of all included library files
- --dry-run (-n) Assemble and show errors only, don't write any output
+ --tree Show a tree diagram of all included library files
--help (-h) Print this help information
--verbose, (-v) Print additional information
- --version Print the assembler version and exit
-
-Environment variables:
- TORQUE_LIBS
- A list of colon-separated paths which will be searched to find
- Torque source code files to use as libraries when assembling a
- Torque program. If a library file resolves an unresolved symbol
- in the program being assembled, the library file will be merged
- into the program.
+ --version Print the program version and exit
Output formats:
cmd
@@ -91,9 +99,7 @@ Output formats:
Each word is padded to the nearest byte. Words must all be the same width.
source
Print the source file before assembly, with symbols resolved.
-
-Created by Ben Bridle.
- ");
+");
std::process::exit(0);
}