Skip to content

Commit

Permalink
chore(docs): Document nargo fmt (#3262)
Browse files Browse the repository at this point in the history
  • Loading branch information
Savio-Sou authored and guipublic committed Oct 27, 2023
1 parent 112a33f commit 36508c2
Showing 1 changed file with 105 additions and 101 deletions.
206 changes: 105 additions & 101 deletions docs/docs/nargo/01_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,43 @@ keywords:

## General options

| Option | Description |
|---------------------|------------------------------------------------------|
| `--show-ssa` | Emit debug information for the intermediate SSA IR |
| `--deny-warnings` | Quit execution when warnings are emitted |
| `--silence-warnings`| Suppress warnings |
| `-h, --help` | Print help |
| Option | Description |
| -------------------- | -------------------------------------------------- |
| `--show-ssa` | Emit debug information for the intermediate SSA IR |
| `--deny-warnings` | Quit execution when warnings are emitted |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |

## `nargo help [subcommand]`

Prints the list of available commands or specific information of a subcommand.

_Arguments_

| Argument | Description |
|---------------|--------------------------------------------------------|
| `<subcommand>`| The subcommand whose help message to display |
| Argument | Description |
| -------------- | -------------------------------------------- |
| `<subcommand>` | The subcommand whose help message to display |

## `nargo backend`

Installs and selects custom backends used to generate and verify proofs.

### Commands

| Command | Description |
|------------|--------------------------------------------------|
| `current` | Prints the name of the currently active backend |
| `ls` | Prints the list of currently installed backends |
| `use` | Select the backend to use |
| `install` | Install a new backend from a URL |
| `uninstall`| Uninstalls a backend |
| `help` | Print this message or the help of the given subcommand(s) |
| Command | Description |
| ----------- | --------------------------------------------------------- |
| `current` | Prints the name of the currently active backend |
| `ls` | Prints the list of currently installed backends |
| `use` | Select the backend to use |
| `install` | Install a new backend from a URL |
| `uninstall` | Uninstalls a backend |
| `help` | Print this message or the help of the given subcommand(s) |

### Options

| Option | Description |
|---------------|--------------|
| `-h, --help` | Print help |
| Option | Description |
| ------------ | ----------- |
| `-h, --help` | Print help |

## `nargo check`

Expand All @@ -65,29 +65,29 @@ values of the Noir program respectively.

### Options

| Option | Description |
|----------------------|---------------------------------------------------|
| `--package <PACKAGE>`| The name of the package to check |
| `--workspace` | Check all packages in the workspace |
| `--print-acir` | Display the ACIR for compiled circuit |
| `--deny-warnings` | Treat all warnings as errors |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |
| Option | Description |
| --------------------- | ------------------------------------- |
| `--package <PACKAGE>` | The name of the package to check |
| `--workspace` | Check all packages in the workspace |
| `--print-acir` | Display the ACIR for compiled circuit |
| `--deny-warnings` | Treat all warnings as errors |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |

### `nargo codegen-verifier`

Generate a Solidity verifier smart contract for the program.

### Options

| Option | Description |
|----------------------|---------------------------------------------------|
| `--package <PACKAGE>`| The name of the package to codegen |
| `--workspace` | Codegen all packages in the workspace |
| `--print-acir` | Display the ACIR for compiled circuit |
| `--deny-warnings` | Treat all warnings as errors |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |
| Option | Description |
| --------------------- | ------------------------------------- |
| `--package <PACKAGE>` | The name of the package to codegen |
| `--workspace` | Codegen all packages in the workspace |
| `--print-acir` | Display the ACIR for compiled circuit |
| `--deny-warnings` | Treat all warnings as errors |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |

## `nargo compile`

Expand All @@ -98,71 +98,71 @@ You can also use "build" as an alias for compile (e.g. `nargo build`).

### Options

| Option | Description |
|----------------------|----------------------------------------------------|
| `--include-keys` | Include Proving and Verification keys in the build artifacts |
| `--package <PACKAGE>`| The name of the package to compile |
| `--workspace` | Compile all packages in the workspace |
| `--print-acir` | Display the ACIR for compiled circuit |
| `--deny-warnings` | Treat all warnings as errors |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |
| Option | Description |
| --------------------- | ------------------------------------------------------------ |
| `--include-keys` | Include Proving and Verification keys in the build artifacts |
| `--package <PACKAGE>` | The name of the package to compile |
| `--workspace` | Compile all packages in the workspace |
| `--print-acir` | Display the ACIR for compiled circuit |
| `--deny-warnings` | Treat all warnings as errors |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |

## `nargo new <PATH>`

Creates a new Noir project in a new folder.

**Arguments**

| Argument | Description |
|-----------|------------------------------------|
| `<PATH>` | The path to save the new project |
| Argument | Description |
| -------- | -------------------------------- |
| `<PATH>` | The path to save the new project |

### Options

| Option | Description |
|-------------------|-------------------------------------------------|
| `--name <NAME>` | Name of the package [default: package directory name] |
| `--lib` | Use a library template |
| `--bin` | Use a binary template [default] |
| `--contract` | Use a contract template |
| `-h, --help` | Print help |
| Option | Description |
| --------------- | ----------------------------------------------------- |
| `--name <NAME>` | Name of the package [default: package directory name] |
| `--lib` | Use a library template |
| `--bin` | Use a binary template [default] |
| `--contract` | Use a contract template |
| `-h, --help` | Print help |

## `nargo init`

Creates a new Noir project in the current directory.

### Options

| Option | Description |
|-------------------|-------------------------------------------------|
| `--name <NAME>` | Name of the package [default: current directory name] |
| `--lib` | Use a library template |
| `--bin` | Use a binary template [default] |
| `--contract` | Use a contract template |
| `-h, --help` | Print help |
| Option | Description |
| --------------- | ----------------------------------------------------- |
| `--name <NAME>` | Name of the package [default: current directory name] |
| `--lib` | Use a library template |
| `--bin` | Use a binary template [default] |
| `--contract` | Use a contract template |
| `-h, --help` | Print help |

## `nargo execute [WITNESS_NAME]`

Runs the Noir program and prints its return value.

**Arguments**

| Argument | Description |
|-----------------|------------------------------------------------|
| `[WITNESS_NAME]`| Write the execution witness to named file |
| Argument | Description |
| ---------------- | ----------------------------------------- |
| `[WITNESS_NAME]` | Write the execution witness to named file |

### Options

| Option | Description |
|-------------------------------|------------------------------------------------------------------|
| Option | Description |
| --------------------------------- | ------------------------------------------------------------------------------------ |
| `-p, --prover-name <PROVER_NAME>` | The name of the toml file which contains the inputs for the prover [default: Prover] |
| `--package <PACKAGE>` | The name of the package to execute |
| `--workspace` | Execute all packages in the workspace |
| `--print-acir` | Display the ACIR for compiled circuit |
| `--deny-warnings` | Treat all warnings as errors |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |
| `--package <PACKAGE>` | The name of the package to execute |
| `--workspace` | Execute all packages in the workspace |
| `--print-acir` | Display the ACIR for compiled circuit |
| `--deny-warnings` | Treat all warnings as errors |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |

_Usage_

Expand All @@ -178,33 +178,33 @@ Creates a proof for the program.

### Options

| Option | Description |
|-------------------------------|------------------------------------------------------------------|
| `-p, --prover-name <PROVER_NAME>` | The name of the toml file which contains the inputs for the prover [default: Prover] |
| Option | Description |
| ------------------------------------- | ---------------------------------------------------------------------------------------- |
| `-p, --prover-name <PROVER_NAME>` | The name of the toml file which contains the inputs for the prover [default: Prover] |
| `-v, --verifier-name <VERIFIER_NAME>` | The name of the toml file which contains the inputs for the verifier [default: Verifier] |
| `--verify` | Verify proof after proving |
| `--package <PACKAGE>` | The name of the package to prove |
| `--workspace` | Prove all packages in the workspace |
| `--print-acir` | Display the ACIR for compiled circuit |
| `--deny-warnings` | Treat all warnings as errors |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |
| `--verify` | Verify proof after proving |
| `--package <PACKAGE>` | The name of the package to prove |
| `--workspace` | Prove all packages in the workspace |
| `--print-acir` | Display the ACIR for compiled circuit |
| `--deny-warnings` | Treat all warnings as errors |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |

## `nargo verify`

Given a proof and a program, verify whether the proof is valid.

### Options

| Option | Description |
|-------------------------------|------------------------------------------------------------------|
| Option | Description |
| ------------------------------------- | ---------------------------------------------------------------------------------------- |
| `-v, --verifier-name <VERIFIER_NAME>` | The name of the toml file which contains the inputs for the verifier [default: Verifier] |
| `--package <PACKAGE>` | The name of the package to verify |
| `--workspace` | Verify all packages in the workspace |
| `--print-acir` | Display the ACIR for compiled circuit |
| `--deny-warnings` | Treat all warnings as errors |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |
| `--package <PACKAGE>` | The name of the package to verify |
| `--workspace` | Verify all packages in the workspace |
| `--print-acir` | Display the ACIR for compiled circuit |
| `--deny-warnings` | Treat all warnings as errors |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |

## `nargo test [TEST_NAME]`

Expand All @@ -217,16 +217,16 @@ See an example on the [testing page](./testing).

### Options

| Option | Description |
|----------------------|---------------------------------------------------|
| `--show-output` | Display output of `println` statements |
| `--exact` | Only run tests that match exactly |
| `--package <PACKAGE>`| The name of the package to test |
| `--workspace` | Test all packages in the workspace |
| `--print-acir` | Display the ACIR for compiled circuit |
| `--deny-warnings` | Treat all warnings as errors |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |
| Option | Description |
| --------------------- | -------------------------------------- |
| `--show-output` | Display output of `println` statements |
| `--exact` | Only run tests that match exactly |
| `--package <PACKAGE>` | The name of the package to test |
| `--workspace` | Test all packages in the workspace |
| `--print-acir` | Display the ACIR for compiled circuit |
| `--deny-warnings` | Treat all warnings as errors |
| `--silence-warnings` | Suppress warnings |
| `-h, --help` | Print help |

## `nargo info`

Expand All @@ -244,3 +244,7 @@ above information about each function of the contract.

Start a long-running Language Server process that communicates over stdin/stdout.
Usually this command is not run by a user, but instead will be run by a Language Client, such as [vscode-noir](https://github.com/noir-lang/vscode-noir).

## `nargo fmt`

Automatically formats your Noir source code based on the default formatting settings.

0 comments on commit 36508c2

Please sign in to comment.