@ -25,9 +25,17 @@ that is appreciated by most Go programmers, see for example the following
@@ -25,9 +25,17 @@ that is appreciated by most Go programmers, see for example the following
The main interface to Runic is the command line interface (CLI) through the `main` function
invoked with the `-m` flag. See the output of `julia -m Runic --help` for details:
invoked with the `-m` flag. See the output of `julia -m Runic --help` below for usage
details.
> [!TIP]
> You can add the following snippet to your shell startup file so that you can invoke the
> CLI a bit simpler:
> ```sh
> alias runic="julia -m Runic"
> ```
The following snippet can be added to your shell startup file so that the CLI can be invoked
a bit more ergonomically. This assumes Runic is installed in the `@runic` shared project as
suggested in the [Installation](#installation) section above. Adjust the `--project` flag if
you installed Runic elsewhere.
```sh
alias runic="julia --project=@runic -m Runic"
```
> [!NOTE]
> The `-m` command line flag is only available in Julia 1.12 and later. In earlier versions
@ -52,11 +63,11 @@ invoked with the `-m` flag. See the output of `julia -m Runic --help` for detail
@@ -52,11 +63,11 @@ invoked with the `-m` flag. See the output of `julia -m Runic --help` for detail
> ```
> For this incantation the following shell alias can be used:
> ```sh
> alias runic="julia -e 'using Runic; exit(Runic.main(ARGS))' --"
> alias runic="julia --project=@runic -e 'using Runic; exit(Runic.main(ARGS))' --"
Input path(s) (files and/or directories) to process. For directories,
all files (recursively) with the '*.jl' suffix are used as input files.
If path is `-` input is read from stdin.
If path is `-` input is read from stdin and output written to stdout.
-c, --check
Do not write output and exit with a non-zero code if the input is not
@ -105,32 +116,38 @@ In addition to the CLI there is also the two function `Runic.format_file` and
@@ -105,32 +116,38 @@ In addition to the CLI there is also the two function `Runic.format_file` and
#### Neovim
Runic can be as a formatter in [Neovim](https://neovim.io/) using
Runic can be used as a formatter in [Neovim](https://neovim.io/) using
[`conform.nvim`](https://github.com/stevearc/conform.nvim). Refer to the `conform.nvim`
repository for installation and setup instructions.
Runic is not (yet) available directly in `conform.nvim` so the following configuration needs
to be passed to the setup function:
to be passed to the setup function. This assumes Runic is installed in the `@runic` shared
project as suggested in the [Installation](#installation) section above. Adjust the
`--project` flag if you installed Runic elsewhere.