From c7b5669c789b9be92370b4c937686579bce0953e Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Thu, 7 Dec 2023 19:21:41 +0100 Subject: [PATCH] Add docs for shell completion --- CHANGELOG.md | 8 ++++++++ changelog.yaml | 5 +++-- docs/SUMMARY.md | 1 + docs/changelog.md | 8 ++++++++ docs/shell_completion.md | 31 +++++++++++++++++++++++++++++++ 5 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 docs/shell_completion.md diff --git a/CHANGELOG.md b/CHANGELOG.md index d020355..8f236c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ Changelog +**0.40.0 (TBA)** + +* Migrate to `click` for commandline arguments. BC should be mostly preserved, + please report any issues. +* Add shell completion, see: https://toot.bezdomni.net/shell_completion.html +* Remove deprecated `--disable-https` option for `login` and `login_cli`, pass + the base URL instead + **0.39.0 (2023-11-23)** * Add `--json` option to many commands, this makes them print the JSON data diff --git a/changelog.yaml b/changelog.yaml index 93aed2c..7f7854e 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -1,8 +1,9 @@ 0.40.0: date: TBA changes: - - "Migrated to `click` for commandline arguments. BC should be mostly preserved, please report any issues." - - "Removed the deprecated `--disable-https` option for `login` and `login_cli`, pass the base URL instead" + - "Migrate to `click` for commandline arguments. BC should be mostly preserved, please report any issues." + - "Add shell completion, see: https://toot.bezdomni.net/shell_completion.html" + - "Remove deprecated `--disable-https` option for `login` and `login_cli`, pass the base URL instead" 0.39.0: date: 2023-11-23 diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 5c67529..d2d19a0 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -6,6 +6,7 @@ - [Usage](usage.md) - [Advanced](advanced.md) - [Settings](settings.md) + - [Shell completion](shell_completion.md) - [TUI](tui.md) - [Contributing](contributing.md) - [Documentation](documentation.md) diff --git a/docs/changelog.md b/docs/changelog.md index d020355..8f236c3 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -3,6 +3,14 @@ Changelog +**0.40.0 (TBA)** + +* Migrate to `click` for commandline arguments. BC should be mostly preserved, + please report any issues. +* Add shell completion, see: https://toot.bezdomni.net/shell_completion.html +* Remove deprecated `--disable-https` option for `login` and `login_cli`, pass + the base URL instead + **0.39.0 (2023-11-23)** * Add `--json` option to many commands, this makes them print the JSON data diff --git a/docs/shell_completion.md b/docs/shell_completion.md new file mode 100644 index 0000000..d4086b8 --- /dev/null +++ b/docs/shell_completion.md @@ -0,0 +1,31 @@ +# Shell completion + +> Introduced in toot 0.40.0 + +Toot uses [Click shell completion](https://click.palletsprojects.com/en/8.1.x/shell-completion/) which works on Bash, Fish and Zsh. + +To enable completion, toot must be [installed](./installation.html) as a command and available by ivoking `toot`. Then follow the instructions for your shell. + +**Bash** + +Add to `~/.bashrc`: + +``` +eval "$(_TOOT_COMPLETE=bash_source toot)" +``` + +**Fish** + +Add to `~/.config/fish/completions/toot.fish`: + +``` +_TOOT_COMPLETE=fish_source toot | source +``` + +**Zsh** + +Add to `~/.zshrc`: + +``` +eval "$(_TOOT_COMPLETE=zsh_source toot)" +```