Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): Document nargo fmt #3262

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@

## 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 @@

### 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 @@

### 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,38 +178,38 @@

### 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]`

Nargo will automatically compile and run any functions which have the decorator `#[test]` on them if
you run `nargo test`. To print `println` statements in tests, use the `--show-output` flag.

Check warning on line 212 in docs/docs/nargo/01_commands.md

View workflow job for this annotation

GitHub Actions / Spellcheck / Spellcheck

Unknown word (println)

Takes an optional `--exact` flag which allows you to select tests based on an exact name.

Expand All @@ -217,16 +217,16 @@

### 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 |

Check warning on line 222 in docs/docs/nargo/01_commands.md

View workflow job for this annotation

GitHub Actions / Spellcheck / Spellcheck

Unknown word (println)
| `--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 @@

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.
Loading