Closed Freed-Wu closed 1 year ago
Your work is very interesting, and it would be a nice addition to trash-cli. This pull request is too big for me to review it and to be sure it does not change anything that should stay unchanged. Please send me first the part that move trash-put optparse to argparse, so I can review it more easily.
This PR has rebased to optparse2argparse.
Thank for you contribution about the argparse. When you have time please resolve conflicts and update this pull requests.
Now, it is OK.
❯ trash -<TAB>
file
option
-d ignored (for GNU rm compatibility)
--directory ignored (for GNU rm compatibility)
--force silently ignore nonexistent files
...
❯ trash --trash-dir <TAB>
trash_dirs
/home/wzy/.local/share/Trash /mnt/.Trash-1000 /tmp/.Trash-1000
❯ trash --trash-dir /home/wzy/.local/share/Trash <TAB>
file
bugs.txt dist/ man/ README.rst scripts/ TODO.txt trash-empty* trash-rm*
conftest.py docs/ ptt_files/ README_zh-CN.rst setup.cfg trash* trash-list* Vagrantfile
COPYING DONE.txt __pycache__/ requirements-dev.txt setup.py trashcli/ trash-put*
CREDITS.txt HISTORY.txt pyproject.toml requirements.txt tests/ trash_cli.egg-info/ trash-restore*
❯ trash --trash-dir /home/wzy/.local/share/Trash bugs.txt <TAB>
file
conftest.py docs/ ptt_files/ README_zh-CN.rst setup.cfg trash* trash-list* Vagrantfile
COPYING DONE.txt __pycache__/ requirements-dev.txt setup.py trashcli/ trash-put*
CREDITS.txt HISTORY.txt pyproject.toml requirements.txt tests/ trash_cli.egg-info/ trash-restore*
dist/ man/ README.rst scripts/ TODO.txt trash-empty* trash-rm*
# Note bugs.txt has been removed from list.
What happened?
/usr/local/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +2bc7c83969bf7acab5de357db9c64339171ee1e0:refs/remotes/pull/248/merge
Error: fatal: unable to access 'https://github.com/andreafrancia/trash-cli/': The requested URL returned error: 429
What happened?
/usr/local/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +2bc7c83969bf7acab5de357db9c64339171ee1e0:refs/remotes/pull/248/merge Error: fatal: unable to access 'https://github.com/andreafrancia/trash-cli/': The requested URL returned error: 429
I don't know. According to mdn 429 is the status code for "Too Many Requests", maybe it is something transient.
I've reran the Actions. Let see if this time it does got a 429.
OK, have finished.
Merged! Thank you.
shtab only support argparse, so trash-put use a manual written zsh script trash-rm use default completion
Install
Result
It is better than https://github.com/zsh-users/zsh-completions/blob/master/src/_trash (
_trash_*
), because the latter is out of date (cmd options).PS: since now, shtab cannot handle
nargs="+"
. So change it to:_trash
is same as_trash-put
.