This patch adds a quick start section to the README with copy-pasteable
setup commands. Closes#80. Also removes some discussion about shell
alias and the `-m` flag and instead recommend using the shell script
wrapper.
@ -20,6 +20,7 @@ that is appreciated by most Go programmers, see for example the following
@@ -20,6 +20,7 @@ that is appreciated by most Go programmers, see for example the following
### Table of contents
- [Quick start](#quick-start)
- [Installation](#installation)
- [Usage](#usage)
- [CLI](#cli)
@ -33,6 +34,31 @@ that is appreciated by most Go programmers, see for example the following
@@ -33,6 +34,31 @@ that is appreciated by most Go programmers, see for example the following
Assuming `~/.local/bin` is in your `PATH` you can now invoke `runic`, e.g.:
```sh
runic --version # Show version info
runic --help # Show documentation
```
```sh
# Format all files in-place in the current directory (recursively)
# !! DON'T DO THIS FROM YOUR HOME DIRECTORY !!
runic --inplace .
```
## Installation
Runic can be installed with Julia's package manager:
@ -48,34 +74,69 @@ Runic in a separate project such as e.g. the shared project `@runic`:
@@ -48,34 +74,69 @@ Runic in a separate project such as e.g. the shared project `@runic`:
julia --project=@runic -e 'using Pkg; Pkg.add("Runic")'
```
## Usage
### CLI
The main interface to Runic is the command line interface (CLI) through the `main` function:
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` below for usage
details.
```sh
julia --project=@runic -e 'using Runic; exit(Runic.main(ARGS))' -- <args>
```
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.
To simplify the invocation of the CLI it is recommended to install the
[`runic`](https://github.com/fredrikekre/Runic.jl/blob/master/bin/runic) shell script into a
directory in your `PATH`. This can be done with the following commands (replace the two