Коммит 88f1026c создал по автору keewek's avatar keewek
Просмотр файлов

release: v1.0.0

владелец a706ce8c
.DS_Store
*.exe
*.out
bin/
dist/
tmp/
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ansible-pretty-print
Upstream-Contact: Alexander Bugrov <abugrov+dev@gmail.com>
Source: https://github.com/keewek/ansible-pretty-print
Files:
assets/*
src/app/version.txt
src/app/testdata/*
src/ui/testdata/*
.gitattributes
.gitignore
CHANGELOG.md
README.md
go.mod
go.sum
Makefile
Copyright: 2023 Alexander Bugrov <abugrov+dev@gmail.com>
License: MIT
# Change Log
All notable changes to the "ansible-pretty-print" CLI tool will be documented in this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
<!-- ## [Unreleased] -->
## [1.0.0] - 2023-05-13
- Initial release
[Unreleased]: https://github.com/keewek/ansible-pretty-print/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/keewek/ansible-pretty-print/releases/tag/v1.0.0
......@@ -2,20 +2,19 @@ MIT License
Copyright (c) 2023 Alexander Bugrov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.PHONY : help
help :
@echo "Usage:"
@echo
@awk '/^###/ { $$1 = " "; print }' ${MAKEFILE_LIST} | column -t -s ':'
### build: build for the current system
.PHONY : build
build :
CGO_ENABLED=0 go build -v -trimpath
### install: build and install to `$GOPATH/bin` (`$HOME/go/bin` if the GOPATH environment variable is not set)
.PHONY : install
install :
CGO_ENABLED=0 go install -v -trimpath
### cover: show coverage report in the default Web browser
.PHONY : cover
cover :
go tool cover -html=cover.out
### test: run tests
.PHONY : test
test :
go test ./src/...
### test-full: run tests with coverage
.PHONY : test-full
test-full :
go test -v=1 -count=1 -coverprofile=cover.out ./src/...
### clean: remove binaries, coverage data, `bin` and `dist` folders
.PHONY : clean
clean :
go clean
rm -f *.out
rm -rf bin/
rm -rf dist/
# ansible-pretty-print
CLI tool that pretty-prints an output of `ansible-playbook --list-tasks` command.
[![](assets/docs/830_table_dos.png)](https://raw.githubusercontent.com/keewek/ansible-pretty-print/main/assets/docs/table_dos.png)
## Install
`go install github.com/keewek/ansible-pretty-print@latest`
or download app executable at [Releases](https://github.com/keewek/ansible-pretty-print/releases) page
## Usage
```
Usage: ansible-pretty-print [OPTION]... [FILE]
Pretty-print Ansible's --list-tasks output
-chop
chop long lines
-dos
DOS box-drawing characters
-indent
indent block/role
-mono
calculate string width as monospace width
-stats
print stats
-stdin
read standard input
-table
table output
-version
output version information
-width int
custom line width
```
- File
`ansible-pretty-print path/to/ansible--list-tasks-output`
- Stdin
`ansible-playbook --list-tasks path/to/playbook -i path/to/inventory | ansible-pretty-print --stdin`
- BASH function
```bash
lt-ansible-playbook() {
ansible-playbook --list-tasks "$@" | ansible-pretty-print --stdin --chop
}
ltt-ansible-playbook() {
ansible-playbook --list-tasks "$@" | ansible-pretty-print --stdin --dos --table
}
```
**Columns output:**
`lt-ansible-playbook --list-tasks path/to/playbook -i path/to/inventory`
**Table output:**
`ltt-ansible-playbook --list-tasks path/to/playbook -i path/to/inventory`
## Features
- Default output
[![](assets/docs/830_columns.png)](https://raw.githubusercontent.com/keewek/ansible-pretty-print/main/assets/docs/columns.png)
- Flag `--indent`: indent block/role
[![](assets/docs/830_columns_indent.png)](https://raw.githubusercontent.com/keewek/ansible-pretty-print/main/assets/docs/columns_indent.png)
- Flag `--chop`: chop long lines
[![](assets/docs/830_columns_chop_120.png)](https://raw.githubusercontent.com/keewek/ansible-pretty-print/main/assets/docs/columns_chop_120.png)
> Use `--width` flag to specify custom width
- Flag `--table`: table output
[![](assets/docs/830_table.png)](https://raw.githubusercontent.com/keewek/ansible-pretty-print/main/assets/docs/table.png)
> Use `--width` flag to specify custom width
[![](assets/docs/830_table_80.png)](https://raw.githubusercontent.com/keewek/ansible-pretty-print/main/assets/docs/table_80.png)
- Flag `--dos`: DOS box-drawing characters
[![](assets/docs/830_table_dos.png)](https://raw.githubusercontent.com/keewek/ansible-pretty-print/main/assets/docs/table_dos.png)
- Flag `--mono`: calculate string width as monospace width
Use with East-Asian content
[![](assets/docs/830__table_EA.png)](https://raw.githubusercontent.com/keewek/ansible-pretty-print/main/assets/docs/table_EA.png)
[![](assets/docs/830__table_EA_mono.png)](https://raw.githubusercontent.com/keewek/ansible-pretty-print/main/assets/docs/table_EA_mono.png)
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать