forked from StackExchange/dnscontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOCS: Add missing docs for fmt, global flags, preview-push (StackExch…
…ange#2886) Co-authored-by: Jeffrey Cafferata <[email protected]>
- Loading branch information
1 parent
5e211fc
commit 293d5cb
Showing
5 changed files
with
178 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# fmt | ||
|
||
This is a stand-alone utility to pretty-format your `dnsconfig.js` configuration file. | ||
|
||
```shell | ||
NAME: | ||
dnscontrol fmt - [BETA] Format and prettify a given file | ||
|
||
USAGE: | ||
dnscontrol fmt [command options] [arguments...] | ||
|
||
CATEGORY: | ||
utility | ||
|
||
OPTIONS: | ||
--input value, -i value Input file (default: "dnsconfig.js") | ||
--output value, -o value Output file | ||
--help, -h show help | ||
``` | ||
|
||
## Examples | ||
|
||
By default the output goes to stdout: | ||
|
||
```shell | ||
dnscontrol fmt >new-dnsconfig.js | ||
``` | ||
|
||
You can also redirect the output via the `-o` option: | ||
|
||
```shell | ||
dnscontrol fmt -o new-dnsconfig.js | ||
``` | ||
|
||
The **safest** method involves making a backup first: | ||
|
||
```shell | ||
cp dnsconfig.js dnsconfig.js.BACKUP | ||
dnscontrol fmt -i dnsconfig.js.BACKUP -o dnsconfig.js | ||
``` | ||
|
||
The **riskiest** method depends on the fact that DNSControl currently processes | ||
the `-o` file after the input file is completely read. It makes no backups. | ||
This is useful if Git is your backup mechanism. | ||
|
||
```shell | ||
git commit -m'backup dnsconfig.js' dnsconfig.js | ||
dnscontrol fmt -o dnsconfig.js | ||
git diff -- dnsconfig.js | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Global Flags | ||
|
||
These flags are global. They affect all subcommands. | ||
|
||
```text | ||
--debug, -v Enable detailed logging (default: false) | ||
--allow-fetch Enable JS fetch(), dangerous on untrusted code! (default: false) | ||
--disableordering Disables update reordering (default: false) | ||
--no-colors Disable colors (default: false) | ||
--help, -h show help | ||
``` | ||
|
||
They must appear before the subcommand. | ||
|
||
**Right** | ||
|
||
{% hint style="success" %} | ||
```shell | ||
dnscontrol --no-colors preview | ||
``` | ||
{% endhint %} | ||
|
||
**Wrong** | ||
|
||
{% hint style="danger" %} | ||
```shell | ||
dnscontrol preview --no-colors | ||
``` | ||
{% endhint %} | ||
|
||
* `-debug` | ||
* Enable debug output. (The `-v` alias is the original name for this flag. That alias will go away eventually.) | ||
|
||
|
||
* `--allow-fetch` | ||
* Enable the `fetch()` function in `dnsconfig.js` (or equivalent). It is disabled by default because it can be used for nefarious purposes. It is dangerous on untrusted code! Enable it only if you trust all the people editing dnsconfig.js. | ||
|
||
* `--disableordering` | ||
* Disables update reordering. Normally DNSControl re-orders the updates done by `push`. This is usually only used to work around bugs in the reordering code. | ||
|
||
* `--no-colors` | ||
* Disable colors. See [Disabling Colors](colors.md) for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters