aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-31 09:04:08 +0200
committerDanilo M. <danix@danix.xyz>2026-07-31 09:04:08 +0200
commit24282ce623c8fa2994cc51723f96adc9d64e4b67 (patch)
treef1196ce7bfb0ef44903921150f0fc3d912be7762 /README.md
parent2a52cb81744a55251dfd05cc1b2c4ee8dd311ebe (diff)
downloadtg_backup-master.tar.gz
tg_backup-master.zip
feat: add bash completionHEADmaster
Completes the flags, and directories for --archive-dir in both the --opt value and --opt=value forms. --target offers only "me": real chat handles would need a network round-trip inside a tab press, and --list-chats already answers that question. Installed by hand, nothing automates it. A new flag has to be added to opts in the completion as well. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/README.md b/README.md
index 29c7521..05707ea 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,15 @@ pip install telethon
cp tg_backup.py ~/bin/ && chmod +x ~/bin/tg_backup.py
```
+Tab completion for the options, if you want it:
+
+```bash
+sudo install -m 644 tg_backup.bash-completion \
+ /usr/share/bash-completion/completions/tg_backup.py
+```
+
+Without root, `source` that file from your `~/.bashrc` instead. It completes flags and directories for `--archive-dir`; chat targets are not completed, since listing them needs a network round-trip.
+
## Setup
Run it once with no arguments to create the config:
@@ -116,6 +125,7 @@ Only media is saved. Message text and captions are not.
| `<archive-dir>/state.json` | Resume position and saved target for that chat |
| `<archive-dir>/failures.json` | Message IDs whose media never downloaded |
| `<archive-dir>/*` | Downloaded media |
+| `/usr/share/bash-completion/completions/tg_backup.py` | Tab completion, if installed |
The session file is account credentials: anyone holding it can read your Telegram. It is created mode `0600` inside a `0700` directory. Keep it out of version control and off shared storage.