diff --git a/README.md b/README.md index c71778d..3feff3d 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,12 @@ in which case it will beautify each one of the files. Available flags are: -|Flag |Short|Meaning |Usage| -| ------------- | ---- | ---------------------------------------- |----------| -|`--files` |`-f` |Files to beautify |`-f foo.sh bar.sh`| -|`--indent-size`|`-i` |Number of spaces to use as indentation|`-i 4`| -|`--backup` |`-b` |Create a backup file before beautifying |`-b`| -| `--tab` |`-t` |Use tabs instead of spaces | `-t` | +| Flag | Short | Meaning | Usage | +| --------------- | ----- | ------------------------------------------ |------------------- | +| `--files` | `-f` | Files to beautify | `-f foo.sh bar.sh` | +| `--indent-size` | `-i` | Number of spaces to use as indentation | `-i 4` | +| `--backup` | `-b` | Create a backup file before beautifying | `-b` | +| `--tab` | `-t` | Use tabs instead of spaces | `-t` | You can use `-` as an argument to `-f` and beautysh will use stdin as it's source and stdout as it's sink @@ -123,7 +123,7 @@ x23LimitStringx23 fi ``` -Special comments '@formatter:off' and '@formatter:on' can be used to disable formatting around a block of statements. +Special comments `@formatter:off` and `@formatter:on` are available to disable formatting around a block of statements. ```shell # @formatter:off @@ -133,7 +133,9 @@ command \ --option3 \ # @formatter:on -This is modeled after the Eclipse feature. +``` +This takes inspiration from the Eclipse feature. + ________________________________________________________________________________ Originally written by [Paul Lutus](http://arachnoid.com/python/beautify_bash_program.html) diff --git a/README.rst b/README.rst index 66a81ea..cea30ce 100644 --- a/README.rst +++ b/README.rst @@ -56,6 +56,8 @@ Available flags are: +---------------------+----------+-------------------------------------------+------------------------+ | ``--backup`` | ``-b`` | Create a backup file before beautifying | ``-b`` | +---------------------+----------+-------------------------------------------+------------------------+ +| ``--tab`` | ``-t`` | Use tabs instead of spaces | ``-t`` | ++---------------------+----------+-------------------------------------------+------------------------+ You can use ``-`` as an argument to ``-f`` and beautysh will use stdin as it's source and stdout as it's sink @@ -98,9 +100,9 @@ As well as the more obvious example: **CAUTION**: Because Beautysh overwrites all the files submitted to it, this could have disastrous consequences if the files include some of the increasingly common Bash scripts that have appended - binary content (a regime where Beautysh has undefined behavior ). So - please — back up your files, and don't treat Beautysh as a harmless - utility. Even if that is true most of the time. + binary content (a regime where Beautysh has undefined behaviour ). + So please — back up your files, and don't treat Beautysh as a + harmless utility. Even if that is true most of the time. Beautysh handles Bash here-docs with care(and there are probably some border cases it doesn't handle). The basic idea is that the originator @@ -130,6 +132,20 @@ here-doc content unchanged: fi +Special comments ``@formatter:off`` and ``@formatter:on`` are available +to disable formatting around a block of statements. + +.. code:: shell + + # @formatter:off + command \ + --option1 \ + --option2 \ + --option3 \ + # @formatter:on + +This takes inspiration from the Eclipse feature. + -------------- Originally written by `Paul diff --git a/beautysh/__init__.py b/beautysh/__init__.py index f6652cf..fbfc0a2 100644 --- a/beautysh/__init__.py +++ b/beautysh/__init__.py @@ -2,4 +2,4 @@ from .beautysh import Beautify -__version__ = '3.1' +__version__ = '3.3'