Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.5 KB

fmt.md

File metadata and controls

55 lines (40 loc) · 1.5 KB
title rootform fmt
description Format Rootform files

Format Rootform files.

Usage

rootform fmt [path] [options]

Options

Flag Type Default Description
--check bool false check formatting without rewriting files
--diff bool false show formatting changes without rewriting files

Global options

Flag Type Default Description
-h, --help bool false show how to use rootform fmt
--color mode auto color human output: auto|always|never; default: auto
--no-pager bool false print a long report in full instead of opening it in less

Behavior

Rewrite Rootform source files using the canonical format.

Without a path, fmt reads the current directory. By default it rewrites changed files. --check reports their names and --diff writes changes to standard output without rewriting. Diagnostics go to standard error.

Exit status

Status Description
0 the sources are formatted
1 a source cannot be parsed, or --check or --diff found a source that is not formatted
2 the command was used incorrectly
4 a source could not be read or rewritten

Examples

rootform fmt
rootform fmt ./dialects
rootform fmt --check
rootform fmt ./dialects --diff