Skip to content

Commit

Permalink
docs: add documentation for the fmt command.
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Sep 9, 2024
1 parent 7abaa80 commit d0db2d1
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions site/content/docs/intro/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Commands:
scan Scan a file or directory
compile Compile rules to binary form
dump Show the data produced by YARA modules for a file
fmt Format YARA source files
completion Output shell completion code for the specified shell
help Print this message or the help of the given subcommand(s)
Expand Down Expand Up @@ -299,7 +300,7 @@ This option can be used multiple times for specifying more than one module.
For example:

```
yr dump --module=pe --module=dotnet [FILE]
yr dump --module=pe --module=dotnet <FILE>
```

### --no-colors
Expand All @@ -309,4 +310,21 @@ Turn off output colors.
By default, both YAML and JSON outputs contains colors that improves their
legibility, this option turns off colors. When the output of this command is
redirected from stdout to a file, colors are turned off automatically, even
if `--no-colors` is missing.
if `--no-colors` is missing.

## fmt

Format YARA source files.

This command is similar in spirit to other code formatting tools like `gofmt`
and `rustfmt`.

```
yr fmt <FILE>...
```

### ---check, -c

Run in "check" mode. Doesn't modify any file, but exits error code 0 if the
files are formatted correctly and no change is necessary, or error code 1
if otherwise.

0 comments on commit d0db2d1

Please sign in to comment.