Updated documentation

This commit is contained in:
Eduard Urbach 2025-02-17 11:05:17 +01:00
parent 3fb6061c30
commit 5905a5bfa5
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
2 changed files with 20 additions and 27 deletions

View File

@ -18,6 +18,9 @@ go build
``` ```
This will place the compiler inside the repository. This will place the compiler inside the repository.
### Symlink
Either use `./q` for the following examples or get access to the shorter `q` in any directory via symlink: Either use `./q` for the following examples or get access to the shorter `q` in any directory via symlink:
```shell ```shell
@ -28,36 +31,26 @@ This assumes that your shell loads `~/.local/bin`.
## Usage ## Usage
```shell
q [command] [options]
``` ```
Usage:
The `build` command creates an executable: q [command] [options]
```shell Commands:
q build examples/hello
build [directory | file] build an executable from a file or directory
--arch [arch] cross-compile for another CPU architecture [x86|arm|riscv]
--assembler, -a show assembler instructions
--dry, -d skip writing the executable to disk
--os [os] cross-compile for another OS [linux|mac|windows]
--statistics, -s show statistics
--verbose, -v show everything
run [directory | file] build and run the executable
system show system information
help show this help
``` ```
The `run` command does everything `build` does but also executes it:
```shell
q run examples/hello
```
You don't have to use physical directories, it's perfectly valid to use a list of files:
```shell
q build hello.q world.q
```
To show verbose compiler output use `-v` or `--verbose`:
```shell
q build examples/hello -v
```
For more information see `q help`.
## Platforms ## Platforms
You can cross-compile executables for Linux, Mac and Windows. You can cross-compile executables for Linux, Mac and Windows.

View File

@ -14,10 +14,10 @@ func Help(w io.Writer, code int) int {
Commands: Commands:
build [directory | file] build an executable from a file or directory build [directory | file] build an executable from a file or directory
--arch [arch] cross-compile for a different CPU architecture (x86, arm or riscv) --arch [arch] cross-compile for another CPU architecture [x86|arm|riscv]
--assembler, -a show assembler instructions --assembler, -a show assembler instructions
--dry, -d skip writing the executable to disk --dry, -d skip writing the executable to disk
--os [os] cross-compile for a different OS (linux, mac or windows) --os [os] cross-compile for another OS [linux|mac|windows]
--statistics, -s show statistics --statistics, -s show statistics
--verbose, -v show everything --verbose, -v show everything