orhun / rustypaste-cli

A CLI tool for rustypaste
https://github.com/orhun/rustypaste
MIT License
56 stars 8 forks source link

feat(cli): add option to delete file(s) from server #54

Closed tessus closed 1 year ago

tessus commented 1 year ago

add support for https://github.com/orhun/rustypaste/pull/136

The delete_token in the config file can be overwritten on the command line with -a <delete_token>. auth and delete tokens are mutually exclusive, thus I didn't create a separate option for the delete token, but just reused the existing one (-a).

normal output

$ rpaste -s https://rptest.local/paste README.md
https://rptest.local/paste/README.JSNI.md
$ rpaste -s https://rptest.local/paste README.md -lp
     Name      | Size |    Expiry (UTC)
---------------|------|--------------------
README.JSNI.md | 3957 | 2023-09-03 21:38:56

$ rpaste -s https://rptest.local/paste -d README.JSNI.md
Deleted

$ rpaste -s https://rptest.local/paste -d README.JSNI.md
Delete error: `file is not found or expired :(`

pretty output

$ rpaste -s https://rptest.local/paste README.md
https://rptest.local/paste/README.UA86.md
$ rpaste -s https://rptest.local/paste README.md -lp
     Name      | Size |    Expiry (UTC)
---------------|------|--------------------
README.UA86.md | 3957 | 2023-09-03 21:39:52

$ rpaste -s https://rptest.local/paste -d README.UA86.md -p
README.UA86.md => Deleted

$ rpaste -s https://rptest.local/paste -d README.UA86.md -p
README.UA86.md => Delete error: `file is not found or expired :(`
tessus commented 1 year ago

If you still want to test beta/nightly, I think it would be better to use a separate workflow or step and ignore the result. The result might be interesting to know, but it shouldn't block the merge (nor show the ci run as failed).

orhun commented 1 year ago

Can you also update README.md about this?

tessus commented 1 year ago

Can you also update README.md about this?

Yep, I will update the README.md and config.toml files.

tessus commented 1 year ago

Please let me know, if something is still missing.

orhun commented 1 year ago

Looks good, I will probably test/merge this tomorrow and create a release.