tfcensus config init
Writes a config file that lists every key commented out at its default, so the file changes nothing until you uncomment a key. It goes to .tfcensus.yaml in the working directory, to path, or with --user to the user file. The directory is created when it's missing.
An existing file is kept, with exit code 2, unless you pass --force. The written path goes to stderr.
Usage
sh
tfcensus config init [path] [flags]Arguments
| Argument | Required | Repeatable |
|---|---|---|
path | no | no |
Flags
| Flag | Description | Type | Default | Values | Config key | Notes |
|---|---|---|---|---|---|---|
--force | replace an existing file | bool | ||||
--user | write the user file instead of .tfcensus.yaml | bool |
The global flags work with every command.
Output formats
This command ignores --format.
Exit codes
| Code | Meaning |
|---|---|
| 0 | The command finished. With --fail-on, nothing matched. |
| 1 | The command failed: a read, a write, a child process or a check failed. |
| 2 | Wrong usage: an unknown command or flag, a bad value or argument, an invalid config file, or a prompt with no terminal. |
| 130 | Interrupted by Ctrl-C (SIGINT) or a cancelled context. |
All codes are listed on the exit codes page.
Examples
sh
tfcensus config init
tfcensus config init --user
tfcensus config init ci/tfcensus.yaml --force