diff --git a/README.md b/README.md index c59cc6a..1b693c1 100644 --- a/README.md +++ b/README.md @@ -33,29 +33,38 @@ python3 -m pip install yamlfixer-opt-nc This software automatically fixes some errors and warnings reported by `yamllint`. - - ```shell -$ yamlfixer [--debug] [--verbose] [--backup] *.yml - thisfile.yaml +yamlfixer --help +usage: yamlfixer [-h] [-v] [-b] [-d] [-j | -s] [file [file ...]] + +Fix formatting problems in YAML documents. If no file is specified, +then reads input from `stdin`. + +positional arguments: + file the YAML files to fix. Use `-` to read from `stdin`. + +optional arguments: + -h, --help show this help message and exit + -v, --version display this program's version number + -b, --backup make a backup copy of original files as `.orig` + -d, --debug output debug information to stderr. + -j, --jsonsummary output JSON summary to stderr. + -s, --summary output plain text summary to stderr. ``` -or: - -```shell -$ yamlfixer [--help] [--version] -``` - -This will launch `yamllint` on each specified filename, then parse its -output and try to fix the reported problems. The special filename `-` -means `stdin`, and is assumed if there's no other filename argument. +yamlfixer launches `yamllint` on each specified filename, then parses +its output and try to fix the reported problems. The special filename +`-` means `stdin`, and is assumed if there's no other filename +argument. If input is read from `stdin`, the corrected output will be sent to `stdout`. + Other files will be overwritten if needed. Original files, `stdin` excepted, can be preserved as `.orig` if the `--backup` command line option is used. -Diagnostic information is sent to stderr in verbose or debug modes. +Both summaries and diagnostic information are sent to stderr. This command exits with `-2` if yamllint is not available on your system. Otherwise it exits with `0` if all input files either are diff --git a/setup.cfg b/setup.cfg index b16813b..8d4c184 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [metadata] -version = 0.3.0 +version = 0.3.1 name = yamlfixer-opt-nc description = automates the fixing of problems reported by yamllint long_description = file: README.md @@ -11,7 +11,8 @@ long_description_content_type = text/markdown url = https://github.com/opt-nc/yamlfixer project_urls = Bug Tracker = https://github.com/opt-nc/yamlfixer/issues - Releases = https://github.com/opt-nc/yamlfixer/releases + GitHub Releases = https://github.com/opt-nc/yamlfixer/releases + Files = https://pypi.org/project/yamlfixer-opt-nc/#files classifiers = Programming Language :: Python :: 3 License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+) diff --git a/yamlfixer/__init__.py b/yamlfixer/__init__.py index 928aa13..451fc41 100755 --- a/yamlfixer/__init__.py +++ b/yamlfixer/__init__.py @@ -10,7 +10,7 @@ import argparse import json -__version__ = "0.3.0" +__version__ = "0.3.1" __author__ = "OPT-NC" __license__ = "GPLv3+" __copyright__ = "Copyright (C) 2021-%s %s" % (time.strftime("%Y",