Skip to content

Commit

Permalink
feat(cli): added (#45)
Browse files Browse the repository at this point in the history
* feat(cli): added

* Update cli.md

* feat(started): merged cli to usage

* zed + vim
  • Loading branch information
Mte90 authored Sep 25, 2024
1 parent 030a576 commit 6c386a3
Showing 1 changed file with 48 additions and 4 deletions.
52 changes: 48 additions & 4 deletions docs/getting_started/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,40 @@

Amber CLI can be used as a runtime or as a compiler.

## Syntax Highlighting
You can install syntax highlighting for Visual Studio Code. You can find it in Visual Studio Code extension store under the name **Amber Language**.
## Command Line Interface (CLI) Parameters

Or you can download it here in [the Visual Studio Marketplace website](https://marketplace.visualstudio.com/items?itemName=Ph0enixKM.amber-language).
*This output is generated from the 0.3.5-alpha version.*
```
Usage: amber [OPTIONS] [INPUT] [OUTPUT]
Arguments:
[INPUT] '-' to read from stdin
[OUTPUT] '-' to output to stdout, '--silent' to discard
Options:
-e, --eval <EVAL> Code to evaluate
--docs Generate docs (OUTPUT is dir instead, default: `docs/`)
--disable-format Don't format the output file
--minify Minify the resulting code
-h, --help Print help
-V, --version Print version
```

For detailed usage instructions, refer to the [Amber usage guide](https://docs.amber-lang.com/getting_started/usage).

### Documentation Generation

The `--docs` option extracts comments prefixed with `///` (triple slashes) from the Amber file and generates a Markdown file for documentation.

#### Disable formatting

Using the `--disable-format` option prevents the execution of external formatting tools after the Bash compilation process.

### Minification

## Running
The `--minify` option compresses the generated Bash code to reduce its size.

### Running

For example the following line will simply execute `file.ab` as a script file. Amber code will be compiled to BashScript and then executed all in one go.

Expand Down Expand Up @@ -39,3 +67,19 @@ Furthermore, Amber adds a _shebang_ at the top of the compiled script. This enab
```sh
./output.sh
```

## Syntax Highlighting

### Visual Studio Code

You can find it in Visual Studio Code extension store under the name **Amber Language**.

Or you can download it here in [the Visual Studio Marketplace website](https://marketplace.visualstudio.com/items?itemName=Ph0enixKM.amber-language).

### Zed

You can download it from https://github.com/amber-lang/zed-amber-extension.

### Vim

There is a WIP syntax color scheme at https://github.com/gbhorwood/amber.vim

0 comments on commit 6c386a3

Please sign in to comment.