kdlfmt v0.0.14
kdlfmt
A formatter for kdl documents.
kdlfmt is a thin cli wrapper built on-top of the official kdl parser for Rust (kdl-rs), so any formatting/parsing issues should be reported there.
kdlfmt 0.0.12
A code formatter for kdl documents.
Mads Hougesen <mads@mhouge.dk>
Usage: kdlfmt <COMMAND>
Commands:
format Format kdl files
check Validate files are formatted
init Initialize formatter config
completions Generate shell completions
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print versionInstallation
kdlfmt can be installed using Cargo, the package manager for Rust (crates.io).
cargo install kdlfmtIf you do not have/want Rust installed on your device you can find precompiled binaries on the release page.
Usage
Once installed the formatted can be invoked by running kdlfmt format.
kdlfmt format PATHFormat kdl files
Usage: kdlfmt format [OPTIONS] [INPUT]...
Arguments:
[INPUT]... Path to file OR directory. Use "-" to read from stdin
Options:
--kdl-version <KDL_VERSION> kdl specification to use. By default all versions are tried [possible values: v1, v2]
--log-level <LOG_LEVEL> [possible values: trace, debug, info, warn, error, off]
-h, --help Print help
-V, --version Print versionValidating files are formatted
kdlfmt also support validating if files are formatted using the kdlfmt check command.
kdlfmt check PATHValidate files are formatted
Usage: kdlfmt check [OPTIONS] [INPUT]...
Arguments:
[INPUT]... Path to file OR directory. Use "-" to read from stdin
Options:
--kdl-version <KDL_VERSION> kdl specification to use. By default all versions are tried [possible values: v1, v2]
--log-level <LOG_LEVEL> [possible values: trace, debug, info, warn, error, off]
-h, --help Print help
-V, --version Print versionIgnoring files
.kdlfmtignore files are used to ignore files/directories.
It uses the same syntax as .gitignore files.
Shell completion
Shell completion can be generated using the kdl completions command.
Generate shell completions
Usage: kdlfmt completions <SHELL>
Arguments:
<SHELL> [possible values: bash, elvish, fish, powershell, zsh]
Options:
-h, --help Print help
-V, --version Print versionBash
Add the following to your .bashrc.
eval "$(kdlfmt completions bash)"Bash
Add the following to your .zshrc:
eval "$(kdlfmt completions zsh)"Fish
Add the following to ~/.config/fish/config.fish.
kdlfmt completions fish | sourcePowerShell
Add the following to your PowerShell configuration (Can be found by running $PROFILE).
Invoke-Expression (&kdlfmt completions powershell)Elvish
Add the following to ~/.elvish/rc.elv.
eval (kdlfmt completions elvish)9 months ago