Compare commits

...
Sign in to create a new pull request.

404 commits

Author SHA1 Message Date
timvisee
238f1f54d7
Bump MSRV to 1.63.0 2023-08-20 17:48:39 +02:00
timvisee
5df8463b74
Bump dependencies 2023-08-20 17:37:36 +02:00
timvisee
8d8ad7fdb3
Revert "Upgrade to libssl3/openssl3."
This reverts commit 5fd2eac6eb.
2023-05-18 23:12:06 +02:00
timvisee
f06b639542
Merge branch 'sarrchri-linux-libssl3' into master
See https://github.com/timvisee/ffsend/pull/156
2023-05-18 23:00:57 +02:00
Christian Sarre
5fd2eac6eb Upgrade to libssl3/openssl3. 2023-04-12 13:59:56 +03:00
timvisee
e0821c751d
Merge branch 'alichtman-master' into master
See https://github.com/timvisee/ffsend/pull/154
2023-04-07 08:25:20 +02:00
Aaron Lichtman
3c1c2dc28c
Fix segfault
close  #153
2023-04-06 23:14:09 -07:00
timvisee
13f9edd2ea
Bump MSRV to 1.60 2023-02-20 11:16:30 +01:00
timvisee
fd5b38f9ab
Update dependencies 2023-02-14 14:00:41 +01:00
timvisee
6661a58770
Revert "Use shorter passphrase words, make them less than 32-characters long"
This reverts commit fdf8ae9201.

This is reverted because the password length limit is now set much
higher, see: https://github.com/timvisee/send/pull/147
2023-02-14 13:59:44 +01:00
Tim Visée
b2b287e34f Merge branch 'prettytable-rs-features' into 'master'
Disable unused features in prettytable-rs crate

See merge request timvisee/ffsend!41
2022-11-14 17:49:35 +00:00
Jakub Jirutka
9b8dee12ea Disable unused features in prettytable-rs crate
ffsend doesn't use csv.
2022-10-09 21:57:19 +02:00
timvisee
a98c9d1ce4
Merge branch 'kianmeng-fix-typos' into master
See https://github.com/timvisee/ffsend/pull/144
2022-10-05 16:07:03 +02:00
Kian-Meng Ang
f77f9f116a Fix typos
Found via `codespell -S *.svg -L crate,ser`
2022-10-05 21:52:50 +08:00
timvisee
afb004680b
Update dependencies 2022-08-18 16:51:01 +02:00
timvisee
6edc0b1eac
Merge branch 'master' of gitlab.com:timvisee/ffsend 2022-07-04 18:38:44 +02:00
timvisee
7c94f265e2
Update Send link in README, point to repository instead 2022-07-04 18:38:35 +02:00
Tim Visée
d33c03cd2c Merge branch 'nautilus-script' into 'master'
Add script for Nautilus

See merge request timvisee/ffsend!39
2022-06-27 13:22:36 +00:00
getzze
ecc6bcf736 add script for Nautilus 2022-06-27 13:46:50 +01:00
timvisee
3e9a4d67f2
Bump version to 0.2.76 2022-06-20 10:09:01 +02:00
timvisee
ea87a778b3
Update dependencies 2022-06-20 10:08:45 +02:00
timvisee
91cf01ec75
Fix Snapcraft CI release, use new authentication method 2022-06-20 10:04:37 +02:00
timvisee
7598063e36
Bump version to 0.2.75 2022-06-19 02:01:33 +02:00
timvisee
6672891490
Update dependencies 2022-06-19 02:01:12 +02:00
timvisee
8139e3be01
Bump MSRV to 1.56.1 2022-06-19 01:42:32 +02:00
timvisee
ac9f56945b
Update dependencies 2022-06-19 01:41:03 +02:00
timvisee
b42225be76
Update dependencies 2022-06-07 10:29:32 +02:00
dependabot[bot]
1a5ec2de79
Bump regex from 1.5.4 to 1.5.5
Bumps [regex](https://github.com/rust-lang/regex) from 1.5.4 to 1.5.5.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.5.4...1.5.5)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 21:18:06 +00:00
timvisee
216772361a
Remove deprecated badges from Cargo.toml 2021-10-15 12:36:05 +02:00
timvisee
55c243a007
Update dependencies 2021-10-14 22:52:02 +02:00
timvisee
ccd489ce2e
Bump version to 0.2.74 2021-10-07 13:32:06 +02:00
timvisee
8026a79478
Update dependencies 2021-10-07 13:31:30 +02:00
Tim Visée
92ab75f837 Merge branch '113-update-static-openssl' into 'master'
Resolve "Update static OpenSSL"

Closes #113

See merge request timvisee/ffsend!38
2021-10-07 11:29:13 +00:00
timvisee
011d97f843
Compile OpenSSL with no-async 2021-10-07 13:09:39 +02:00
timvisee
3782996376
Update static OpenSSL version to 1.1.1k 2021-10-07 13:09:38 +02:00
timvisee
8f909b805b
Revert "Use latest ca-certificates for ffsend binary test against public instance"
This reverts commit 4c55145a07.
2021-10-07 13:09:24 +02:00
timvisee
178b73f210
Update dependencies 2021-10-06 13:51:38 +02:00
timvisee
4c55145a07
Use latest ca-certificates for ffsend binary test against public instance 2021-10-04 12:45:11 +02:00
timvisee
faa1141a2b
Further improve Arch AUR packages
Based on comments at:
10977f056d

Thanks @alerque
2021-08-31 16:03:38 +02:00
timvisee
10977f056d
Update Arch AUR packages to latest standards
Suggested by https://aur.archlinux.org/packages/ffsend/#comment-824438
2021-08-31 15:32:58 +02:00
timvisee
e2f9b75844
Bump version to 0.2.73 2021-08-30 14:19:44 +02:00
timvisee
e5fd4c237b
Update dependencies 2021-08-30 14:18:58 +02:00
timvisee
4593ece50f
Update dependencies 2021-08-26 20:37:43 +02:00
timvisee
cf8c13afa2
Merge branch 'a1346054-fixes' into master
See https://github.com/timvisee/ffsend/pull/129
2021-08-26 16:33:48 +02:00
a1346054
7e5c750340 Trim excess whitespace 2021-08-26 14:24:23 +00:00
a1346054
e2c20840e4 Fix spelling 2021-08-26 13:41:29 +00:00
a1346054
c7c53d8649 Fix issues in scripts identified using shellcheck 2021-08-25 22:31:38 +00:00
a1346054
1dcecbc281 Invoke bash using /usr/bin/env instead of hardcoded path 2021-08-25 22:30:17 +00:00
a1346054
485e5cd088 Use https links 2021-08-25 22:29:23 +00:00
a1346054
42dffc864d Use correct license file
The current file was missing the "How to Apply These Terms to Your New
Programs" section, which is an integral part of the GPL and is not
supposed to be removed:

https://www.gnu.org/licenses/gpl-faq.html#GPLOmitPreamble

Correct file was downloaded from:
https://www.gnu.org/licenses/gpl-3.0.txt
2021-08-25 22:23:37 +00:00
a1346054
abe52c831d Don't parse output of ls 2021-08-25 21:54:57 +00:00
timvisee
2322096927
Update README, link to issue explaining default host, remove old info 2021-06-24 16:40:35 +02:00
timvisee
22c53316ab
Replace use of deprecated URL to string function
See https://gitlab.com/timvisee/ffsend/-/issues/110
2021-05-09 17:37:20 +02:00
timvisee
e440f4b68a
Bump version to 0.2.72 2021-05-08 00:12:02 +02:00
timvisee
e96d2a7a0b
Update dependencies 2021-05-08 00:11:31 +02:00
timvisee
e03dec6d91
Add FFSEND_DOWNLOAD_LIMIT environment variable 2021-05-08 00:06:59 +02:00
timvisee
4ced2ea4d0
Change Firefox Send branding to Send 2021-05-05 22:33:41 +02:00
timvisee
924cfbeb95
Replace Mozilla's Send links with @timvisee's Send links in README
For more details see: https://gitlab.com/timvisee/ffsend/-/issues/101
2021-05-05 22:28:28 +02:00
timvisee
8266fcb633
Change CI AUR build image from archlinux/base to archlinux 2021-05-02 17:54:08 +02:00
timvisee
796098093b
Update dependencies 2021-04-21 19:13:07 +02:00
timvisee
8bd3efb1c4
Shell completion generation status should print to stderr, not stdout 2021-04-21 19:11:54 +02:00
timvisee
463130cdf8
Merge branch 'herbygillot-patch-1' into 'master' 2021-04-09 18:54:01 +02:00
Herby Gillot
2d7fd864b3
README: add MacPorts install info 2021-04-09 12:41:21 -04:00
timvisee
68a57b5ccc
Bump version to 0.2.71 2021-04-09 16:21:17 +02:00
timvisee
63faf51685
Fix compilation error due to missing imports 2021-04-09 16:20:42 +02:00
timvisee
37cdba8ddd
Add support to upload file from stdin
Fixes https://github.com/timvisee/ffsend/issues/39
2021-04-09 15:53:06 +02:00
timvisee
9908084745
Bump version to 0.2.70 2021-04-09 14:48:51 +02:00
timvisee
1070f1f297
Bump MSRV to 1.46
See https://github.com/rust-lang/rust/issues/49146
2021-04-09 14:48:06 +02:00
timvisee
f418bc47ab
Bump version to 0.2.69 2021-04-09 14:41:29 +02:00
timvisee
29069012f7
Update dependencies 2021-04-09 14:36:06 +02:00
timvisee
ce5d31e546
Add environment variable to set default upload expiry time
See https://github.com/timvisee/ffsend/issues/124
2021-04-09 14:32:13 +02:00
timvisee
d75e69841e
Bump minimum Rust version to 1.43.0 2021-01-04 12:51:35 +01:00
timvisee
dfb773a96e
Fix compilation error due to rand API change 2021-01-04 12:33:09 +01:00
timvisee
ba865715d7
Update dependencies 2021-01-04 11:44:33 +01:00
timvisee
549657df21
Remove redundant extern crate imports 2020-10-26 12:32:54 +01:00
timvisee
65306a30e8
Run non dependent jobs concurrently across stages in GitLab CI 2020-10-26 12:28:48 +01:00
timvisee
01e9524e7d
Remove instructions from LICENSE file 2020-10-21 23:28:06 +02:00
timvisee
1664c48d7d
Bump version to 0.2.68 2020-10-16 14:36:51 +02:00
timvisee
8524993e89
Update dependencies 2020-10-16 14:36:34 +02:00
timvisee
87816a58e2
Update ffsend-api to 0.6.3 for increased limits 2020-10-16 14:33:46 +02:00
timvisee
ed34588184
Bump version to 0.2.67 2020-09-27 15:33:47 +02:00
timvisee
cb98358fb9
Update dependencies 2020-09-27 15:33:09 +02:00
Tim Visée
fa0ecf61bc Merge branch '104-fix-share-url-printing-on-windows' into 'master'
Resolve "Fix share URL printing on Windows"

Closes #104

See merge request timvisee/ffsend!37
2020-09-27 13:31:25 +00:00
timvisee
b52b2256b8
Print additional newline on Windows before share URL 2020-09-26 20:47:28 +02:00
timvisee
a20deeb759
Print upload complete notice below progress bar, attempt to fix URL 2020-09-24 22:43:01 +02:00
timvisee
3a90b0b0b1
Bump version to 0.2.66 2020-09-21 12:24:16 +02:00
timvisee
70710c14ed
Update dependencies 2020-09-21 12:23:45 +02:00
timvisee
3fd00cfdc3
Update host info in README 2020-09-21 12:16:06 +02:00
timvisee
3d60493573
Update command line about notice, add donate link 2020-09-21 12:09:48 +02:00
timvisee
56ab026d22
Update custom host info notice in README, add donation link 2020-08-25 13:19:03 +02:00
timvisee
ed78f29ccf
Merge branch 'master' of gitlab.com:timvisee/ffsend 2020-08-19 11:37:09 +02:00
timvisee
e1e1343b31
Update Docker image maintainer label 2020-08-19 11:36:54 +02:00
timvisee
d779188a73
Update ffsend-api dependency 2020-07-30 19:06:19 +02:00
timvisee
42bbfac6bd
Update dependencies 2020-07-30 18:23:52 +02:00
timvisee
ff91585e1b
Make notice on top of README less verbose 2020-07-09 12:53:34 +02:00
timvisee
4de467a86f
Bump version to 0.2.65 2020-07-09 12:50:56 +02:00
timvisee
d0a01ca34e
Add notice about default host switch to top of README 2020-07-09 12:48:59 +02:00
timvisee
8658a68b23
Update dependencies 2020-07-09 12:46:27 +02:00
timvisee
522bf187f5
Use send.vis.ee as default host until Mozilla's Firefox Send is up again
See https://gitlab.com/timvisee/ffsend/-/issues/101
2020-07-09 12:45:57 +02:00
timvisee
62133be103
Make temporarily unavailable notice bold 2020-07-09 09:50:21 +02:00
timvisee
290a057b7e
Add temporarily unavailable notice to README 2020-07-09 09:49:52 +02:00
timvisee
0032555348
Merge branch 'vlcinsky-master'
See https://github.com/timvisee/ffsend/pull/117
2020-06-21 22:01:49 +02:00
Jan Vlcinsky
7c6d2ac6a3 README admits, only annonymous client is supported now. 2020-06-21 21:42:45 +02:00
Jan Vlcinsky
36ebce88cf Help text --basic-auth explains it is for protected proxy, not FxA 2020-06-21 21:37:46 +02:00
timvisee
24304200a8
Bump minimum Rust version to 1.40 2020-05-30 16:19:12 +02:00
timvisee
48c2804885
Update dependencies 2020-05-30 16:17:38 +02:00
timvisee
3aab4bcd5f
Update Cargo.lock 2020-05-30 16:16:45 +02:00
timvisee
8e12e2788a
Update Cargo.lock 2020-05-25 19:17:23 +02:00
timvisee
1772ec6b8d
Merge branch 'ignatenkobrain-patch-2'
See https://github.com/timvisee/ffsend/pull/113
2020-05-17 19:17:42 +02:00
Igor Raits
9a0c0eb8d4
README: Improve Fedora description 2020-05-17 19:16:15 +02:00
timvisee
6a94ea759d
Bump version to 0.2.64 2020-05-17 18:14:06 +02:00
timvisee
fd8b4dd050
Fix formatting issue in AUR packages 2020-05-17 18:13:26 +02:00
timvisee
fe0ba4d77b
Bump version to 0.2.63
- OpenSSL is still required on Linux/FreeBSD, update packages
2020-05-17 17:20:04 +02:00
timvisee
727c885f38
Still require OpenSSL on Linux, update README and package definitions
See https://gitlab.com/timvisee/ffsend-api/-/issues/8
2020-05-17 17:19:02 +02:00
timvisee
c670947375
Bump version to 0.2.62
- Implement ring as new crypto backend, used by default
- Disable Send v2 support by default
- Added various new compiler feature flags
- Update dependencies
2020-05-17 15:27:29 +02:00
timvisee
385d9e9224
Update Cargo.lock 2020-05-17 15:24:04 +02:00
timvisee
49f6089f37
Merge branch 'master' of gitlab.com:timvisee/ffsend 2020-05-17 15:22:26 +02:00
timvisee
93f38c5537
Fix build example with no default features missing required feature 2020-05-17 15:21:40 +02:00
Tim Visée
cb7f37efaf Merge branch 'crypto-ring' into 'master'
Implement ring as new crypto backend

See merge request timvisee/ffsend!36
2020-05-17 12:17:58 +00:00
timvisee
b430920157
Revert last change for GitLab CI, do install OpenSSL there 2020-05-17 13:49:06 +02:00
timvisee
3fee8854b7
Do not install OpenSSL on CI 2020-05-17 13:47:40 +02:00
timvisee
eea76722a7
Update compiler feature flag combinations tested in GitLab CI 2020-05-17 13:45:09 +02:00
timvisee
adc20d1357
Update package manifests 2020-05-17 13:42:33 +02:00
timvisee
b18265ab74
Show crypto backend and new compiler features in debug command 2020-05-17 13:42:02 +02:00
timvisee
da21dd894b
Update ffsend to 0.6.0, set up new compiler features 2020-05-17 13:41:04 +02:00
timvisee
60e91abba9
Update compiler flags and OpenSSL notes in README, ring is now default 2020-05-17 13:15:44 +02:00
timvisee
7b610c83d5
Update Cargo.lock 2020-05-16 17:28:47 +02:00
timvisee
3690319a59
Update scoop package manifest URL 2020-05-15 12:40:06 +02:00
timvisee
1ca7720d07
Bump version to 0.2.61 2020-05-11 22:18:01 +02:00
timvisee
bfe4cda42d
Fix github-release binary URL, not in latest release anymore 2020-05-11 22:16:56 +02:00
timvisee
3410340c2d
Bump version to 0.2.60 2020-05-11 21:04:30 +02:00
timvisee
e1b1be6754
Update dependencies 2020-05-11 21:03:00 +02:00
timvisee
20cf8e9ec2
Update Cargo.lock 2020-05-11 20:56:24 +02:00
timvisee
4e1291b3d0
Update Cargo.lock 2020-05-05 01:46:01 +02:00
timvisee
daef5b731c
Update Cargo.lock 2020-04-19 18:11:14 +02:00
timvisee
fba2cad1b6
Update qr2term to v0.2.0 2020-04-19 14:42:34 +02:00
timvisee
7daffe51ec
Revert back to OpenSSL 1.0.2o, but with updated source link 2020-04-03 02:09:28 +02:00
timvisee
62501e4135
Fix OpenSSL download failure on CI, use latest 1.0.2 version 2020-04-03 01:42:07 +02:00
timvisee
6ba3c34362
Bump version to 0.2.59 2020-03-31 02:13:37 +02:00
timvisee
e97b3922f4
Update Cargo.lock 2020-03-31 02:12:54 +02:00
timvisee
a565453949
Generate random name when uploading unnamed archives
Fixes https://github.com/timvisee/ffsend/issues/109
2020-03-31 02:12:13 +02:00
timvisee
5e2b5eb1c2
Merge branch 'master' of gitlab.com:timvisee/ffsend 2020-03-18 19:48:30 +01:00
timvisee
2b34398fbe
Only build docs.rs documentation for GNU Linux 2020-03-18 19:48:13 +01:00
Tim Visée
800fecbb90 Merge branch 'urlshortener-3' into 'master'
Update to urlshortener 3

See merge request timvisee/ffsend!35
2020-03-08 12:59:09 +00:00
Josh Stone
37963f94e7 Update to urlshortener 3 2020-03-06 19:16:29 -08:00
timvisee
5f21b87937
Revert "Remove our complex clipboard logic, use clipboard-ext crate instead"
This reverts commit 8bfe173a18.
2020-02-14 00:24:14 +01:00
timvisee
5b088610dd
Revert "Install python3 dependency in CI"
This reverts commit 0d8bcb08e0.
2020-02-14 00:24:13 +01:00
timvisee
d199a3b62b
Revert "Update minimum Rust version to 1.40"
This reverts commit 0cafab842f.
2020-02-14 00:24:12 +01:00
timvisee
c891f389dc
Revert "Install new test requirements for XCB on CI"
This reverts commit aac53caef4.
2020-02-14 00:24:10 +01:00
timvisee
27854d15bc
Revert "Install XCB dependencies for all jobs globally in CI"
This reverts commit 5afdeccf98.
2020-02-14 00:24:06 +01:00
timvisee
5afdeccf98
Install XCB dependencies for all jobs globally in CI 2020-02-13 22:32:48 +01:00
timvisee
aac53caef4
Install new test requirements for XCB on CI 2020-02-13 21:56:53 +01:00
timvisee
0cafab842f
Update minimum Rust version to 1.40 2020-02-13 21:36:57 +01:00
timvisee
0d8bcb08e0
Install python3 dependency in CI 2020-02-13 21:25:00 +01:00
timvisee
8bfe173a18
Remove our complex clipboard logic, use clipboard-ext crate instead 2020-02-13 20:21:07 +01:00
timvisee
5bea3feffa
Use string slice when setting clipboard using xclip or xsel 2020-02-13 17:26:33 +01:00
timvisee
b780236fa2
Fix duplicate entry in GitLab CI configuration, minor other improvements 2020-02-11 18:24:54 +01:00
timvisee
e73f5d08b4
Minor README tweaks 2020-01-27 14:00:15 +01:00
timvisee
9299ec04eb
Update Cargo.toml version number constraints and Cargo.lock 2020-01-20 18:06:58 +01:00
timvisee
a261afe749
Update ffsend-api dependency to 0.5.0, change min Rust version to 1.39 2020-01-20 18:00:52 +01:00
timvisee
60a130ef2a
Update shell completion scripts 2020-01-10 17:13:36 +01:00
timvisee
a6656c06b2
Fix error in last commit due to incorrect conditional compilation 2020-01-10 16:40:19 +01:00
timvisee
0337632175
Add --delete flag to delete local file after upload 2020-01-10 16:31:09 +01:00
timvisee
fa5560eb9f
Update dependencies 2020-01-10 16:14:16 +01:00
timvisee
638b69325e
Bump version to 0.2.58 2019-12-29 16:12:51 +01:00
timvisee
4c16e38d0d
Update dependencies, add urlshortener compiler feature, fix compilation 2019-12-29 16:11:52 +01:00
timvisee
940093ba13
Merge branch 'kslr-patch-1'
See https://github.com/timvisee/ffsend/pull/103
2019-12-15 14:57:58 +01:00
Kslr
18a578d7d8
Update README.md 2019-12-15 15:55:31 +08:00
timvisee
43eba88b42
Merge branch 'master' of gitlab.com:timvisee/ffsend 2019-12-10 15:32:40 +01:00
timvisee
62f1bce228
Update shell completion scripts 2019-12-10 15:32:24 +01:00
Tim Visée
85b226ca3e Merge branch 'staging' into 'master'
Few small updates and fixes in Cargo.{toml,lock}

See merge request timvisee/ffsend!34
2019-12-06 14:39:33 +00:00
Igor Gnatenko
4100bc69d8
chore: Update ffsend-api in the Cargo.lock
So that dependencies get updated as well.

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2019-12-05 22:27:25 +01:00
Igor Gnatenko
092d47176a
chore: Update chbs to 0.0.9
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2019-12-05 22:25:16 +01:00
Igor Gnatenko
b93e457a52
Revert "chore: Include contrib folder into the crates.io tarball"
I am very sorry, but I realized that those completions can be easily
generated by produced ffsend binary so after all we don't need to ship
those files.

This reverts commit c740ddc676.

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2019-12-05 22:23:31 +01:00
timvisee
55e165f315
Bump version to 0.2.57 2019-12-05 14:38:33 +01:00
timvisee
31c5fff9c7
Merge branch 'ignatenkobrain-patch-1'
See https://github.com/timvisee/ffsend/pull/102
2019-12-05 14:36:41 +01:00
Igor Gnatenko
c740ddc676
chore: Include contrib folder into the crates.io tarball
Otherwise distributions can't make completions available.
2019-12-05 14:28:52 +01:00
timvisee
86d8d5e329
Remove redundant xclip -f flag because we pipe stdout to null now
See https://gitlab.com/timvisee/ffsend/issues/93
2019-12-04 14:00:56 +01:00
Tim Visée
10f5448c0d Merge branch 'remove_aurget_reference' into 'master'
Remove reference to Aurget

See merge request timvisee/ffsend!33
2019-12-04 12:52:01 +00:00
Bram Crielaard
43c6da8cda
Keep recommending ffsend-bin 2019-12-03 19:59:10 +01:00
Bram Crielaard
d2427d78a9
Remove reference to Aurget
Aurget has been deprecated: https://github.com/pbrisbin/aurget/issues/66
As such I would recommend removing it from the install instructions.
2019-12-03 19:59:10 +01:00
timvisee
34b829fca1
Bump version to 0.2.56 2019-12-03 13:48:19 +01:00
timvisee
892e959945
Update dependencies 2019-12-03 13:47:44 +01:00
timvisee
ff657683cc
Pipe clipboard process output to null on Linux 2019-12-03 13:47:25 +01:00
Tim Visée
e9f7dde6fa Merge branch 'fix_xclip_hanging' into 'master'
Add -f flag to xclip, fixing hanging

Closes #93

See merge request timvisee/ffsend!31
2019-12-03 12:35:47 +00:00
Bram Crielaard
69dfaa5970
Add -f flag to xclip, fixing hanging
Fixes #93
2019-12-03 13:34:07 +01:00
timvisee
1082df1d2c
Add Android Termux installation instructions 2019-12-01 12:16:18 +01:00
timvisee
801b946abd
Update dependencies 2019-11-29 16:13:23 +01:00
timvisee
bf36925786
Update minimum Rust requirement to 1.37, fixing CI build 2019-11-06 17:33:46 +01:00
timvisee
624be49503
Update dependencies 2019-11-06 16:52:26 +01:00
timvisee
53649ebbb3
Use duration syntax for CLI timeout options as well 2019-11-04 17:43:51 +01:00
timvisee
e9a2b715d1
Do not snap upload expiry time to fixed list, now allows any duration 2019-11-03 23:07:14 +01:00
timvisee
a4305e19da
Bump version to 0.2.55, fix history for uploads with custom expiry 2019-10-30 21:51:18 +01:00
timvisee
4fd67baa71
Update ffsend-api to 0.4.1, fix history for uploads with custom expiry 2019-10-30 21:50:32 +01:00
timvisee
43c1480233
Fix typo introduced in last commit 2019-10-28 12:38:07 +01:00
timvisee
cc88186b0e
Mention that newer OpenSSL versions can be installed on Windows as well 2019-10-28 12:36:55 +01:00
timvisee
7729ee258d
Bump version to 0.2.54 2019-10-25 15:05:02 +02:00
Tim Visée
4a89cc3f82 Merge branch '85-make-upload-expiry-time-configurable' into 'master'
Resolve "Make upload expiry time configurable"

Closes #85

See merge request timvisee/ffsend!30
2019-10-25 13:03:48 +00:00
timvisee
5f21f49aec
Bump version to 0.2.53 2019-10-25 14:56:49 +02:00
timvisee
6326a88d42
Use hosted ffsend-api, update dependencies 2019-10-25 14:52:57 +02:00
timvisee
9a633d4941
Update README to reflect latest changes 2019-10-24 17:29:08 +02:00
timvisee
98150f7f44
Use human readable format to specify expiry time 2019-10-24 17:27:32 +02:00
timvisee
e39add8ffd
Make file expiry time configurable, update ffsend-api to v0.4.0-git 2019-10-24 16:42:50 +02:00
timvisee
9076744ead
Add notice in README for snap package, it might be troublesome 2019-10-16 22:22:37 +02:00
timvisee
34ee42cf28
Update GitHub sponsor configuration 2019-10-12 14:55:27 +02:00
timvisee
a3a7458478
Update GitHub sponsor configuration 2019-10-07 00:53:43 +02:00
timvisee
b4ed399250
Update Cargo.lock 2019-10-07 00:53:34 +02:00
timvisee
fce3996f31
Attempt to fix snap release, update Windows SSL dependency to fix release 2019-09-30 00:07:56 +02:00
timvisee
76a1328a77
Bump version to 0.2.52, update dependencies to fix nightly compilation 2019-09-29 22:24:18 +02:00
timvisee
5af629860a
Update ffsend-api dependency, update Cargo.lock 2019-09-29 22:16:26 +02:00
timvisee
40d2f351a5
Add Alpine package APKBUILD snippet, proudly stolen from Alpine pkg index 2019-09-24 22:04:55 +02:00
timvisee
29c5c8c975
Add contributed Alpine package to README, link some existing packages 2019-09-24 22:00:44 +02:00
timvisee
17c7f62787
Remove crate download count badge 2019-09-08 17:41:38 +02:00
timvisee
e98ddafda7
Bump version to 0.2.51, install shell completions and update dependencies 2019-08-29 22:07:02 +02:00
timvisee
b69933f200
Fix shell completion installation, add ZSH file and LICENSE in AUR 2019-08-28 19:59:04 +02:00
timvisee
4c185539a4
Update shell completion files 2019-08-28 19:39:22 +02:00
timvisee
0c9f0a01c3
Bump version to 0.2.50, update dependencies 2019-08-25 15:34:49 +02:00
timvisee
f2b98373d9
Update dependencies and Cargo.lock to latest versions, fix some warnings 2019-08-25 15:14:33 +02:00
timvisee
8c554ac43f
Update urlshortener dependency to v2.0 2019-08-25 15:05:25 +02:00
timvisee
e369b581ec
Fix GitLab CI configuration for latest DAG change 2019-08-23 17:33:14 +02:00
timvisee
777ce46fb1
Use DAG in pipeline to speed up overall process 2019-08-23 17:32:15 +02:00
timvisee
bfe30e1be3
Change minimum Rust version to 1.34 2019-08-04 23:17:12 +02:00
timvisee
091fd35410
Update dependencies 2019-08-04 22:49:07 +02:00
timvisee
20c69011ab
Make -P conflict with -p 2019-08-04 22:39:51 +02:00
timvisee
c6066d6ca2
Exclude some more files from packaging, update Cargo.lock 2019-07-17 14:59:29 +02:00
timvisee
c8f3275ed7
Bump version to 0.2.49, update dependencies 2019-06-29 16:14:12 +02:00
timvisee
98fe01c218
Add --clear/--rm flag/option to clear history/remove specific item 2019-06-29 15:57:07 +02:00
timvisee
0394579a2d
Update upload limit in README for Firefox Send service 2019-06-22 22:32:05 +02:00
timvisee
d81b7951ad
Bump version to 0.2.48 2019-06-21 00:20:37 +02:00
timvisee
2babe1af63
Update used OpenSSL version for Windows release 2019-06-21 00:19:53 +02:00
timvisee
ea2286151b
Fix Docker image release job, do not run command with non-zero exit code 2019-06-21 00:18:34 +02:00
timvisee
7e27d7928a
Bump version to 0.2.47, update dependencies 2019-06-20 22:40:41 +02:00
Tim Visée
02559bc6ce Merge branch '30-allow-multi-file-uploads' into 'master'
Support multiple files for uploading through archive

See merge request timvisee/ffsend!29
2019-06-20 20:36:50 +00:00
timvisee
58d44f09d9
Find shared directory for multiple files, use as archive base directory 2019-06-20 22:35:16 +02:00
timvisee
dee5289597
Require user to set file name when archiving multiple files 2019-06-20 21:29:32 +02:00
timvisee
a7582ae765
Show error when archiving files outside working directory 2019-06-20 21:22:03 +02:00
timvisee
ce39eada4c
Allow uploading multiple files by archiving, rework archiving 2019-06-20 21:16:45 +02:00
timvisee
12503d0d21
Update Cargo.lock 2019-06-05 01:31:13 +02:00
timvisee
b228e41753
Update README to match changes in latest commit by @Gahr 2019-06-03 00:47:36 +02:00
Tim Visée
1edf1f8485 Merge branch 'only-output-link' into 'master'
Only output link to stdout

See merge request timvisee/ffsend!28
2019-06-02 20:12:23 +00:00
Wesley Gahr
9cd1f77717
Only output link to stdout when calling upload (without other text) 2019-06-02 21:51:56 +02:00
timvisee
de5a9a470c
Return non-zero exit code when running ffsend with no arguments 2019-06-01 21:39:00 +02:00
timvisee
0adf815e62
Update dependencies 2019-05-30 14:17:56 +02:00
timvisee
4c0629d178
Update Cargo.lock 2019-05-23 22:17:38 +02:00
timvisee
533f1d9444
Add Patreon funding URL 2019-05-23 21:30:40 +02:00
timvisee
e5aa72b971
Add GitHub Sponsors funding links 2019-05-23 21:15:38 +02:00
timvisee
9e504f71ea
Add basic security policy based on GitHub template 2019-05-23 21:05:10 +02:00
timvisee
15a7285ae1
Remove frozen flag from Cargo check due to error 2019-05-10 16:02:58 +02:00
timvisee
757d672df6
Add simple check for up-to-date Cargo.lock in CI, update dependencies 2019-05-10 15:51:35 +02:00
timvisee
7751898851
Bump version to 0.2.46, update dependencies 2019-05-04 14:44:32 +02:00
Tim Visée
d4efd984eb Merge branch 'fix-freebsd-clipboard' into 'master'
Use alternate clipboard method for FreeBSD and other BSD derivatives

See merge request timvisee/ffsend!26
2019-05-04 12:34:22 +00:00
timvisee
0f4e841779
Merge remote-tracking branch 'origin/master' into fix-freebsd-clipboard 2019-05-04 14:33:30 +02:00
timvisee
7ca71ce163
Merge branch '0mp/ffsend-master' into 'master'
See merge request !27
2019-05-04 14:31:19 +02:00
timvisee
4e9603702b
Indent README with spaces 2019-05-04 14:29:36 +02:00
timvisee
cce6218b11
Move FreeBSD items around, move behind Windows 2019-05-04 14:27:54 +02:00
Mateusz Piotrowski
3ae80cbe7b Fix Gentoo indentation 2019-05-02 18:31:12 +02:00
Mateusz Piotrowski
dda9f2c8a1 Add FreeBSD installation and building instructions 2019-05-02 18:30:44 +02:00
timvisee
307284e684
Update README for clipboard support changes 2019-05-02 17:27:55 +02:00
timvisee
d46a40c4a4
Clean up conditional compilation for clipboard support with sub features 2019-05-02 17:23:38 +02:00
timvisee
9982049633
Fix invalid change in last commit causing compilation error 2019-05-02 17:01:49 +02:00
timvisee
ab55390ba8
Use alternate clipboard method for FreeBSD and other BSD derivatives 2019-05-02 16:37:45 +02:00
timvisee
d5bc5a4289
Change OpenSSL download to self hosted mirror due to host being down 2019-05-02 12:35:27 +02:00
timvisee
5951ce5ccc
Update dependencies 2019-04-21 15:40:11 +02:00
timvisee
0a08718b2c
Bump version to 0.2.45, update dependencies 2019-04-18 21:17:22 +02:00
timvisee
59c7ec627f
Show error when attempting to upload file of 0 bytes
Fixes timvisee/ffsend#86
2019-04-18 21:12:53 +02:00
timvisee
22bba025cb
Update dependencies 2019-04-11 17:28:21 +02:00
timvisee
7bfff9a87f
Update dependencies 2019-04-09 18:12:15 +02:00
timvisee
1e86e9d6b3
Update version-compare to 0.0.7 2019-04-09 18:11:35 +02:00
timvisee
0e3f36090c
Fix checked downloads limit not being used for parameters action 2019-04-05 17:13:25 +02:00
timvisee
37579b8f65
Fix force flag not working with invalid download limits 2019-04-05 17:06:16 +02:00
timvisee
1754bda00f
Bump version to 0.2.44 2019-04-05 17:02:42 +02:00
timvisee
e6e84cdcf2
Optimize imports causing a warning 2019-04-05 17:02:13 +02:00
timvisee
888b10afd6
Respect download limits enforced by remote server, update ffsend-api
See issue timvisee/ffsend#17
2019-04-05 16:54:34 +02:00
timvisee
b59650f25d
Switch from quale to which, properly optionally import clipboard crates 2019-04-05 15:15:05 +02:00
timvisee
6feea9b463
Fix AUR binary package setting invalid binary URL in CI on release 2019-04-04 12:12:04 +02:00
timvisee
469b554244
Update dependencies 2019-04-04 10:50:29 +02:00
timvisee
3a59911965
Fix sed commands for AUR packages, escape variables 2019-04-04 10:48:48 +02:00
timvisee
864e94ede3
Comment-out faulty AppVeyor CI statement for GitHub release 2019-04-02 17:13:30 +02:00
timvisee
5a7472cee0
Bump version to 0.2.43, update dependencies 2019-04-02 16:33:02 +02:00
timvisee
d092d7527a
Merge branch 'axionl-master' into 'master'
See pull request timvisee/ffsend#35
2019-04-02 16:31:32 +02:00
timvisee
ed75ed8227
Set proper completion file URLs for AUR 2019-04-02 16:21:26 +02:00
timvisee
156d5db765
Use and cache versioned files for AUR, fix inconsistencies [ci skip] 2019-04-02 16:09:27 +02:00
axionl
e68e0feedd
Add auto completions for bash and fish shell. 2019-04-02 22:40:10 +09:00
timvisee
e52b357e86
Update dependencies 2019-04-01 15:12:56 +02:00
timvisee
2804e42a06
Merge branch 'axionl-master' into 'master'
See pull request timvisee/ffsend#32
2019-03-30 18:29:51 +01:00
axionl
7084bfa8c8
Modify the name to avoid using the locally cached file 2019-03-31 01:04:06 +09:00
timvisee
fbbc84db25
List ffsend-bin AUR package in README again 2019-03-29 18:09:00 +01:00
timvisee
8df3f5ecc7
Remove ffsend-bin AUR package from README for now, mention ffsend package 2019-03-27 19:17:13 +01:00
timvisee
11577a2038
Fix package base for AUR git package, use double quotes to infer vars 2019-03-27 18:13:27 +01:00
timvisee
24629eebdf
Explicitly set AUR binary permission, rename AUR SHA check variables 2019-03-27 16:38:12 +01:00
timvisee
3075b8e8fc
Disable automatic homebrew package releases for now to throttle
See pull request https://github.com/Homebrew/homebrew-core/pull/38274
2019-03-26 14:11:12 +01:00
Tim Visée
29a54d7724 Merge branch 'aur-fix' into 'master'
Fix AUR package names, add git master package, improve automatic releases

Closes #64

See merge request timvisee/ffsend!25
2019-03-26 13:08:52 +00:00
timvisee
a5f3086dcf
Only update AUR git package on release if PKGBUILD has changed 2019-03-26 14:06:26 +01:00
timvisee
e6118122d5
Define ffsend-git AUR package as well, release it through CI 2019-03-26 13:49:16 +01:00
timvisee
100f955071
Fix AUR installer name, should be AUR helper as noted by @murlakatamenka
See merge request timvisee/ffsend!24

Co-authored-by: murlakatamenka <murlakatamenka@disroot.org>
2019-03-26 13:40:57 +01:00
timvisee
4f7e1f5c92
Merge remote-tracking branch 'origin/master' into aur-fix 2019-03-26 13:33:59 +01:00
Tim Visée
f8584df22b Merge branch 'master' into 'master'
Fix AUR package URL; remove yaourt example

See merge request timvisee/ffsend!24
2019-03-26 12:31:28 +00:00
murlakatamenka
88fa345a33 Replace ffsend with ffsend-bin in README 2019-03-26 15:27:56 +03:00
timvisee
e224033286
Merge remote-tracking branch 'origin/master' into aur-fix 2019-03-26 13:08:45 +01:00
timvisee
9ea0d3ba89
Fix some issues as noted by @lilyball
Co-authored-by: Lily Ballard <lily@sb.org>
2019-03-26 13:05:55 +01:00
timvisee
46750793bf
Merge branch 'wilmardo-fix-windows-ci-build'
See pull request timvisee/ffsend#31
2019-03-26 12:59:46 +01:00
timvisee
a4f9a23975
Mention PKGBUILD source locations in a comment 2019-03-26 12:47:21 +01:00
wilmardo
74ca880f11 Fixes the powershell hack for Windows Github release creation 2019-03-26 12:41:14 +01:00
timvisee
8872f375ca
Update AUR package release pipeline: proper names, proper URLs, sha sums 2019-03-26 12:36:16 +01:00
murlakatamenka
387b018182 Restore trimmed trailing whitespaces in README 2019-03-26 11:30:13 +03:00
murlakatamenka
01f8b50d03 Fix AUR package URL; remove yaourt example 2019-03-26 10:27:50 +03:00
timvisee
8f0fdc9751
Force brew package release pull requests, disable errorous AppVeyor command again 2019-03-25 21:47:42 +01:00
timvisee
4e7cdde829
Bump version to 0.2.42 2019-03-25 21:01:52 +01:00
timvisee
dbbf8ac8af
Fix missing import on Windows and macOS 2019-03-25 21:01:05 +01:00
timvisee
7a5a2379e8
Bump version to 0.2.41 2019-03-25 20:35:38 +01:00
timvisee
f0cac5767f
Fix Windows and macOS builds, only use quale dependency on Linux 2019-03-25 20:34:54 +01:00
timvisee
df04b7ae29
Bump version to 0.2.40, update dependencies 2019-03-25 20:22:32 +01:00
timvisee
cc5ad4c9b6
Attemp to fix GitHub release creation on AppVeyor once again 2019-03-25 20:21:31 +01:00
timvisee
8d7bbce4d0
Mention Fedora package in README 2019-03-25 20:12:35 +01:00
timvisee
53e5843fed
Rebuild if XCLIP_PATH or XSEL_PATH environment variable is changed 2019-03-25 19:16:50 +01:00
timvisee
5702367b84
Update clipboard error messages, to reflect support for xclip and xsel 2019-03-25 19:09:43 +01:00
timvisee
982027f33c
Add support for xsel clipboard as well, dynamically select at runtime
Fixes timvisee/ffsend#76
2019-03-25 18:55:34 +01:00
timvisee
c2dfd3e174
Show clipboard information on Linux in debug command output
Fixes gitlab.com/timvisee/ffsend#80
2019-03-25 17:55:53 +01:00
timvisee
32e0e1c48f
Do not use empty binary names 2019-03-25 17:40:53 +01:00
timvisee
f6bf067ff3
Attempt to fix brew push issue, explicitly save Git credentials on host 2019-03-24 18:28:23 +01:00
timvisee
de7945645a
Remove completer property from snapcraft configuration, not supported 2019-03-24 18:22:35 +01:00
timvisee
f51bd673ff
Add nix package installation instructions in README 2019-03-23 19:08:07 +01:00
timvisee
e9d5bec4f5
Bump version to 0.2.39, update dependencies 2019-03-23 18:58:15 +01:00
timvisee
13edd30ff4
Add bash completions file to snap package 2019-03-23 18:56:59 +01:00
timvisee
9d98220083
Move contributing guidelines file to a path GitHub recognizes 2019-03-23 18:54:56 +01:00
timvisee
6158cf6d14
Some contributing guideline improvements 2019-03-23 18:50:32 +01:00
timvisee
a29f380dbe
Add contributing guideline stubs 2019-03-23 18:47:10 +01:00
timvisee
40504e0fd3
Fix homebrew package installation command 2019-03-23 18:00:29 +01:00
timvisee
dc62db19d9
Mention macOS homebrew installation instructions in README 2019-03-23 17:54:35 +01:00
timvisee
d1571ac57f
Automate homebrew package updates using Travis CI 2019-03-23 17:48:27 +01:00
timvisee
fdbdec0722
Update rpassword dependency to 3.0.0 2019-03-21 09:23:14 +01:00
timvisee
c8a854d492
Fix unused import on non-Linux systems
See issue github.com/timvisee/ffsend#29
2019-03-20 00:26:47 +01:00
timvisee
14dbfdfd79
Improve README 2019-03-20 00:23:15 +01:00
timvisee
1376218d30
Describe scriptability in README 2019-03-20 00:20:06 +01:00
timvisee
c2920b507b
Show crate version in debug output 2019-03-19 23:32:20 +01:00
timvisee
8744e05372
Mention previous releases in README for not yet available artifacts 2019-03-19 23:30:51 +01:00
timvisee
8a7703a2ac
Test more compiler feature flag combinations on CI 2019-03-19 23:28:38 +01:00
timvisee
c04ad07b05
Bump version to 0.2.38, update dependencies 2019-03-19 23:19:34 +01:00
Tim Visée
12e6606164 Merge branch 'configurable-client' into 'master'
Add basic HTTP authentication support, update ffsend API dependency

See merge request timvisee/ffsend!23
2019-03-19 22:18:25 +00:00
timvisee
4890b59bd7
Update ffsend-api to 0.3.0 for basic HTTP authentication support 2019-03-19 23:14:20 +01:00
timvisee
556eed4a71
Implement basic HTTP authentication argument and environment variable 2019-03-19 22:09:42 +01:00
timvisee
0052a60503
Implement configurable ffsend API client for new ffsend API update 2019-03-19 21:53:56 +01:00
Tim Visée
2f10b2f057 Merge branch 'xclip_path' into 'master'
Support XCLIP_PATH at compilation to control the path to xclip

Closes #71

See merge request timvisee/ffsend!22
2019-03-19 06:59:15 +00:00
Lily Ballard
8bcf0e4a0e Support XCLIP_PATH at compilation to control the path to xclip
If the `XCLIP_PATH` env var is set during compilation, it will be used
to determine what binary to invoke for copying to the clipboard on
Linux. Otherwise `xclip` will be looked up in the `PATH`.

Fixes #71.
2019-03-18 21:23:57 -07:00
timvisee
f9dcdb0531
Bump version to 0.2.37, update dependencies 2019-03-18 22:42:44 +01:00
timvisee
a86b416640
Merge branch 'nagyf-history_file_permissions' into 'master'
See pull request timvisee/ffsend#26
2019-03-18 22:37:19 +01:00
Ferenc Nagy
50f27189de Set history file permissions on UNIX based systems 2019-03-18 22:29:39 +01:00
timvisee
9b1cf9dab4
Minor README improvements [ci skip] 2019-03-18 21:29:12 +01:00
timvisee
47db4dc7e9
Mention Docker alias in README 2019-03-18 17:09:03 +01:00
timvisee
0f96e3fd2e
Mark generated completion files as vendored for Linguist 2019-03-18 16:54:51 +01:00
timvisee
fba888c5aa
Add common shell completions, fix invalid quiet check 2019-03-18 16:35:02 +01:00
timvisee
2fe8e24fb1
Add command to generate completions 2019-03-18 16:31:43 +01:00
timvisee
d55b3e8ef4
Move zsh completions file 2019-03-18 16:29:40 +01:00
timvisee
1a64e40aa2
Bump version to 0.2.36 2019-03-17 19:46:33 +01:00
timvisee
c6752231be
Remove license property from snapcraft configuration again 2019-03-17 19:45:50 +01:00
timvisee
0c3ac720a5
Bump version to 0.2.35 2019-03-17 18:00:08 +01:00
timvisee
7240ef30ab
Improve README for ffput and ffget 2019-03-17 17:56:18 +01:00
timvisee
a6deb9155b
Implement subcommand inferring based on calling name with feature flag
See issue timvisee/ffsend#24
2019-03-17 17:48:01 +01:00
timvisee
1fc189d4d9
Fix bin_name function giving incorrect results when symlinked 2019-03-17 16:43:20 +01:00
timvisee
d27b48aad0
Add license property to snapcraft configuration 2019-03-16 20:41:38 +01:00
timvisee
e717b1f1a9
Bump version to 0.2.34 2019-03-16 15:52:01 +01:00
timvisee
a694ded0fa
Add desktop interface/plug to snap package, to allow opening in browser
See issue timvisee/ffsend#66
2019-03-16 15:50:25 +01:00
timvisee
55d1934868
Update toml dependency 2019-03-16 15:43:23 +01:00
timvisee
ed049472b9
Merge branch 'nathfreder-patch-1' into 'master'
See pull request timvisee/ffsend#23
2019-03-16 01:40:41 +01:00
timvisee
e162fdb585
Merge branch 'patch-1' of git://github.com/nathfreder/ffsend into nathfreder-patch-1 2019-03-16 01:40:27 +01:00
Nathaniel Fredericks
413328392d
chore(README.md): Fix macOS bin directory 2019-03-15 16:27:22 -03:00
timvisee
085035bf88
List all compiler features in debug output 2019-03-15 13:51:55 +01:00
Tim Visée
32e078e1e1 Merge branch 'master' into 'master'
chore: Update urlshortener to 0.10

See merge request timvisee/ffsend!21
2019-03-15 11:55:42 +00:00
Igor Gnatenko
d142b6183e
chore: Update urlshortener to 0.10
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2019-03-15 09:39:00 +01:00
timvisee
c3c5a6b70d
Bump version to 0.2.33 2019-03-15 01:46:37 +01:00
timvisee
a4a5dd156e
Disable the GitHub release creation task for AppVeyor, until it's fixed 2019-03-15 01:45:49 +01:00
timvisee
f9833dac55
Update README [ci skip] 2019-03-15 01:16:41 +01:00
timvisee
da49dc5345
Fix incorrect conditional compilation feature 2019-03-15 01:12:28 +01:00
timvisee
ddf0e191a3
Test new compiler feature flag combinations in CI 2019-03-15 01:05:02 +01:00
timvisee
c15ef067fe
Bump version to 0.2.32 2019-03-15 00:58:52 +01:00
Tim Visée
866579c80b Merge branch 'shorten-urls' into 'master'
Implement URL shortener support

Closes #68

See merge request timvisee/ffsend!20
2019-03-14 23:57:17 +00:00
timvisee
dd3a4c561f
Follow URL redirects before downloading, this passes URL shorteners 2019-03-15 00:54:56 +01:00
timvisee
dfd9a39633
Attempt to fix AppVeyor release job 2019-03-15 00:24:13 +01:00
timvisee
06ec14c2ee
Do not test ffsend Docker container in interactive mode 2019-03-15 00:22:56 +01:00
timvisee
e2ebbc91a9
Prompt the user to confirm shortening the URL, may be security risk 2019-03-15 00:18:37 +01:00
timvisee
6de33446c7
Implement proper error handling for URL shortening 2019-03-15 00:10:19 +01:00
timvisee
cca5889e39
Implement first URL shortening logic using is.gd 2019-03-14 23:50:38 +01:00
timvisee
417bf803e7
Bump version to 0.2.31, update dependencies 2019-03-14 23:24:51 +01:00
timvisee
2a95eccd0e
Attempt to ignore AppVeyor GitHub release errors 2019-03-14 23:24:08 +01:00
timvisee
01cba1fe35
Update scoop manifest, specify dependency, update related READMEs 2019-03-14 22:30:02 +01:00
Tim Visée
2fe025e88a Merge branch 'master' into 'master'
Created scoop app manifest for ffsend 0.2.30

See merge request timvisee/ffsend!18
2019-03-14 21:25:29 +00:00
Tim Visée
6d58e5efe3 Merge branch 'qrcode' into 'master'
Add support for showing a QR code for a share URL after uploading

See merge request timvisee/ffsend!19
2019-03-14 21:13:06 +00:00
timvisee
176775d9cf
Add support for showing a QR code for a share URL after uploading 2019-03-14 22:12:21 +01:00
timvisee
c068e4c143
Add scoop package instructions 2019-03-14 10:11:58 +01:00
Maxime Blais
41db446812 Created scoop app manifest for ffsend 0.2.30 2019-03-13 17:49:16 -04:00
timvisee
2b2b592155
Merge branch 'master' of gitlab.com:timvisee/ffsend 2019-03-13 20:52:16 +01:00
timvisee
601034e87f
Use proper image, and enable Docker in Docker for Dockerfile job on CI 2019-03-13 20:51:54 +01:00
Tim Visée
e001bfa0db Merge branch 'brew_correction' into 'master'
Updated macOS install information in README.md

See merge request timvisee/ffsend!16
2019-03-13 18:14:21 +00:00
timvisee
09c6ef5764
Merge branch 'ogarcia-zsh-completion' into 'master'
See pull request timvisee/ffsend#16
2019-03-13 19:08:57 +01:00
timvisee
391fe019f6
Merge branch 'zsh-completion' of git://github.com/ogarcia/ffsend into ogarcia-zsh-completion 2019-03-13 19:08:45 +01:00
timvisee
9a6c45b8f3
Bump version to 0.2.30, update dependencies 2019-03-13 18:59:25 +01:00
Tim Visée
a6ce935ea4 Merge branch 'pkg-docker' into 'master'
Create Docker image for easily running ffsend

See merge request timvisee/ffsend!17
2019-03-13 17:57:45 +00:00
timvisee
fad390f584
Describe Docker image usage in README 2019-03-13 18:56:04 +01:00
Óscar García Amor
0e34e2b7aa Added zsh completion
Signed-off-by: Óscar García Amor <ogarcia@connectical.com>
2019-03-13 18:52:36 +01:00
timvisee
5de3f89de7
Add simple Docker image and Docker release job on CI 2019-03-13 18:41:36 +01:00
timvisee
2921f6463d
Merge branch '0xflotus-patch-1'
See pull request timvisee/ffsend#15
2019-03-13 14:57:12 +01:00
0xflotus
af98b77f74
Update README.md 2019-03-13 14:56:24 +01:00
0xflotus
44ea30cbe2
fixed Upcoming 2019-03-13 14:54:43 +01:00
Brian A. Carter
b1f27fc174 1. Corrected name of homebrew command, 2) Added specific required OpenSSL. 2019-03-12 20:53:44 -04:00
83 changed files with 10872 additions and 1836 deletions

3
.gitattributes vendored Normal file
View file

@ -0,0 +1,3 @@
# Mark generated completion files as vendored
contrib/completions/* linguist-vendored
contrib/completions/gen_completions linguist-vendored=false

7
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1,7 @@
# Funding links
github:
- timvisee
custom:
- "https://timvisee.com/donate"
patreon: timvisee
ko_fi: timvisee

View file

@ -14,8 +14,10 @@ stages:
- release
- package
# Variable defaults
variables:
RUST_VERSION: stable
RUST_TARGET: x86_64-unknown-linux-gnu
# Cache rust/cargo/build artifacts
cache:
@ -37,18 +39,20 @@ before_script:
rustc --version
cargo --version
# Variable defaults
variables:
RUST_VERSION: stable
RUST_TARGET: x86_64-unknown-linux-gnu
# Check on stable, beta and nightly
# Check on stable, beta and nightly
.check-base: &check-base
stage: check
script:
- cargo check --verbose
- cargo check --no-default-features --features send2 --verbose
- cargo check --no-default-features --features send3 --verbose
- cargo check --no-default-features --features send3,crypto-ring --verbose
- cargo check --no-default-features --features send2,crypto-openssl --verbose
- cargo check --no-default-features --features send3,crypto-openssl --verbose
- cargo check --no-default-features --features send2,send3,crypto-openssl --verbose
- cargo check --no-default-features --features send3,crypto-ring,archive --verbose
- cargo check --no-default-features --features send3,crypto-ring,history --verbose
- cargo check --no-default-features --features send3,crypto-ring,qrcode --verbose
- cargo check --no-default-features --features send3,crypto-ring,urlshorten --verbose
- cargo check --no-default-features --features send3,crypto-ring,infer-command --verbose
- cargo check --features no-color --verbose
check-stable:
<<: *check-base
@ -60,14 +64,15 @@ check-nightly:
<<: *check-base
variables:
RUST_VERSION: nightly
check-old:
check-msrv:
<<: *check-base
variables:
RUST_VERSION: "1.32.0"
RUST_VERSION: "1.63.0"
# Build using Rust stable
build-x86_64-linux-gnu:
stage: build
needs: []
script:
- cargo build --target=$RUST_TARGET --release --verbose
- mv target/$RUST_TARGET/release/ffsend ./ffsend-$RUST_TARGET
@ -81,6 +86,7 @@ build-x86_64-linux-gnu:
# Build a static version
build-x86_64-linux-musl:
stage: build
needs: []
variables:
RUST_TARGET: x86_64-unknown-linux-musl
script:
@ -88,11 +94,11 @@ build-x86_64-linux-musl:
- rustup target add $RUST_TARGET
# Build OpenSSL statically
- apt install -y build-essential wget musl-tools
- wget https://www.openssl.org/source/openssl-1.0.2o.tar.gz
- tar xzvf openssl-1.0.2o.tar.gz
- cd openssl-1.0.2o
- ./config -fPIC --openssldir=/usr/local/ssl --prefix=/usr/local
- apt-get install -y build-essential wget musl-tools
- wget https://www.openssl.org/source/old/1.1.1/openssl-1.1.1k.tar.gz
- tar xzvf openssl-1.1.1k.tar.gz
- cd openssl-1.1.1k
- ./config no-async -fPIC --openssldir=/usr/local/ssl --prefix=/usr/local
- make
- make install
- cd ..
@ -116,6 +122,7 @@ build-x86_64-linux-musl:
# Run the unit tests through Cargo
test-cargo:
stage: test
needs: []
dependencies: []
script:
- cargo test --verbose
@ -156,7 +163,7 @@ release-crate:
# Snap release
release-snap:
image: snapcore/snapcraft:edge
image: snapcore/snapcraft:stable
stage: release
dependencies: []
only:
@ -165,6 +172,7 @@ release-snap:
script:
# Prepare the environment
- apt-get update -y
- apt-get install python3 -yqq
- cd pkg/snap
# Update version number in snapcraft.yaml
@ -180,7 +188,7 @@ release-snap:
# Publish snap package
- echo "Publishing snap package..."
- echo "$SNAPCRAFT_LOGIN" | base64 -d > snapcraft.login
- snapcraft login --with snapcraft.login
- snapcraft whoami
- snapcraft push --release=stable ffsend_*_amd64.snap
artifacts:
name: ffsend-snap-x86_64
@ -203,7 +211,7 @@ release-github:
- apt-get install -y curl wget gzip netbase
# Download github-release binary
- wget $(curl -s https://api.github.com/repos/tfausak/github-release/releases/latest | grep 'browser_' | cut -d\" -f4 | grep 'linux') -O github-release.gz
- wget https://github.com/tfausak/github-release/releases/download/1.2.5/github-release-linux.gz -O github-release.gz
- gunzip github-release.gz
- chmod a+x ./github-release
@ -212,10 +220,46 @@ release-github:
- ./github-release upload --token "$GITHUB_TOKEN" --owner timvisee --repo ffsend --tag "$CI_COMMIT_REF_NAME" --file ./ffsend-x86_64-unknown-linux-gnu --name ffsend-$CI_COMMIT_REF_NAME-linux-x64
- ./github-release upload --token "$GITHUB_TOKEN" --owner timvisee --repo ffsend --tag "$CI_COMMIT_REF_NAME" --file ./ffsend-x86_64-unknown-linux-musl --name ffsend-$CI_COMMIT_REF_NAME-linux-x64-static
# Publish a Docker image
release-docker:
image: docker:git
stage: release
only:
- /^v(\d+\.)*\d+$/
dependencies:
- build-x86_64-linux-musl
services:
- docker:dind
variables:
RUST_TARGET: x86_64-unknown-linux-musl
DOCKER_HOST: tcp://docker:2375
# DOCKER_DRIVER: overlay2
before_script: []
script:
# Place binary in Docker directory, change to it
- mv ./ffsend-$RUST_TARGET ./pkg/docker/ffsend
- cd ./pkg/docker
# Build the Docker image, run it once to test
- docker build -t timvisee/ffsend:latest ./
- docker run --rm timvisee/ffsend:latest -V
# Retag version
- VERSION=$(echo $CI_COMMIT_REF_NAME | cut -c 2-)
- echo "Determined Docker image version number 'v$VERSION', retagging image..."
- docker tag timvisee/ffsend:latest timvisee/ffsend:$VERSION
# Authenticate and push the Docker images
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USER" --password-stdin
- docker push timvisee/ffsend:$VERSION
- docker push timvisee/ffsend:latest
# AUR packages release
package-aur:
image: archlinux/base
image: archlinux
stage: package
needs:
- release-github
dependencies: []
only:
- /^v(\d+\.)*\d+$/
@ -223,31 +267,81 @@ package-aur:
script:
- cd ./pkg/aur
# Update version number in PKGBUILD
# Determine the version number we're releasing for
- VERSION=$(echo $CI_COMMIT_REF_NAME | cut -c 2-)
- echo "Determined binary version number 'v$VERSION', updating PKGBUILDs..."
- sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i bin/PKGBUILD
- sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i git/PKGBUILD
- echo "Determined binary version number 'v$VERSION'"
# Determine remote URLs and SHA checksums
- echo "Determining SHA checksums for remote files..."
- URL_BIN=https://github.com/timvisee/ffsend/releases/download/v$VERSION/ffsend-v$VERSION-linux-x64-static
- URL_SOURCE=https://gitlab.com/timvisee/ffsend/-/archive/v$VERSION/ffsend-v$VERSION.tar.gz
- URL_BASH_COMPLETION=https://gitlab.com/timvisee/ffsend/raw/v$VERSION/contrib/completions/ffsend.bash
- URL_ZSH_COMPLETION=https://gitlab.com/timvisee/ffsend/raw/v$VERSION/contrib/completions/_ffsend
- URL_FISH_COMPLETION=https://gitlab.com/timvisee/ffsend/raw/v$VERSION/contrib/completions/ffsend.fish
- URL_LICENSE=https://gitlab.com/timvisee/ffsend/raw/v$VERSION/LICENSE
- 'echo "Selected binary URL: $URL_BIN"'
- 'echo "Selected source URL: $URL_SOURCE"'
- echo "Determining sha256sum for remote binary..."
- 'SHA_BIN=$(curl -sSL "$URL_BIN" | sha256sum | cut -d" " -f1)'
- 'echo "Got sha256sum: $SHA_BIN"'
- 'SHA_BASH_COMPLETION=$(curl -sSL "$URL_BASH_COMPLETION" | sha256sum | cut -d" " -f1)'
- 'echo "Got sha256sums of bash completion: $SHA_BASH_COMPLETION"'
- 'SHA_ZSH_COMPLETION=$(curl -sSL "$URL_ZSH_COMPLETION" | sha256sum | cut -d" " -f1)'
- 'echo "Got sha256sums of ZSH completion: $SHA_ZSH_COMPLETION"'
- 'SHA_FISH_COMPLETION=$(curl -sSL "$URL_FISH_COMPLETION" | sha256sum | cut -d" " -f1)'
- 'echo "Got sha256sums of fish completion: $SHA_FISH_COMPLETION"'
- 'SHA_LICENSE=$(curl -sSL "$URL_LICENSE" | sha256sum | cut -d" " -f1)'
- 'echo "Got sha256sums of LICENSE: $SHA_LICENSE"'
- echo "Determining sha256sum for remote source..."
- 'SHA_SOURCE=$(curl -sSL "$URL_SOURCE" | sha256sum | cut -d" " -f1)'
- 'echo "Got sha256sum: $SHA_SOURCE"'
# Update PKGBUILD parameters: version, source URL and SHA sum
- echo "Updating PKGBUILDS with release information..."
- sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i ffsend/PKGBUILD
- sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i ffsend-bin/PKGBUILD
- sed "s/^pkgver=.*\$/pkgver=$VERSION.$CI_COMMIT_SHORT_SHA/" -i ffsend-git/PKGBUILD
- sed "s/^source=(\".*\").*\$/source=(\"$(echo $URL_SOURCE | sed 's/\//\\\//g')\")/" -i ffsend/PKGBUILD
- sed "s/\(\"ffsend-v\$pkgver::\).*\"/\1$(echo $URL_BIN | sed 's/\//\\\//g')\"/" -i ffsend-bin/PKGBUILD
- sed "s/\(\"ffsend-v\$pkgver.bash::\).*\"/\1$(echo $URL_BASH_COMPLETION | sed 's/\//\\\//g')\"/" -i ffsend-bin/PKGBUILD
- sed "s/\(\"ffsend-v\$pkgver.zsh::\).*\"/\1$(echo $URL_ZSH_COMPLETION | sed 's/\//\\\//g')\"/" -i ffsend-bin/PKGBUILD
- sed "s/\(\"ffsend-v\$pkgver.fish::\).*\"/\1$(echo $URL_FISH_COMPLETION | sed 's/\//\\\//g')\"/" -i ffsend-bin/PKGBUILD
- sed "s/\(\"LICENSE-v\$pkgver::\).*\"/\1$(echo $URL_LICENSE | sed 's/\//\\\//g')\"/" -i ffsend-bin/PKGBUILD
- sed "s/^sha256sums=.*\$/sha256sums=('$SHA_SOURCE')/" -i ffsend/PKGBUILD
- sed "s/^sha256sums=.*\$/sha256sums=('$SHA_BIN' '$SHA_BASH_COMPLETION' '$SHA_ZSH_COMPLETION' '$SHA_FISH_COMPLETION' '$SHA_LICENSE')/" -i ffsend-bin/PKGBUILD
# Get SHA hash for local and remote file w/o version, update if it has changed
- 'SHA_STRIP_LOCAL=$(cat ffsend-git/PKGBUILD | sed /^pkgver=.\*/d | sha256sum | cut -d" " -f1)'
- 'SHA_STRIP_REMOTE=$(curl -sSL "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=ffsend-git" | sed /^pkgver=.\*/d | sha256sum | cut -d" " -f1)'
# Install dependencies
- echo "Installing required build packages..."
- pacman -Syu --noconfirm sudo base-devel binutils openssh rust cargo cmake git openssl
# Make AUR package
- echo "Making AUR package..."
- mkdir -p /.cargo
- chmod -R 777 /.cargo
- cd bin/
- cd ffsend-bin/
- echo "Making binary package..."
- sudo -u nobody makepkg -c
- sudo -u nobody makepkg --printsrcinfo > .SRCINFO
- cd ../git
- echo "Making git source package..."
- cd ../ffsend
- echo "Making main source package..."
- sudo -u nobody makepkg -c
- sudo -u nobody makepkg --printsrcinfo > .SRCINFO
# Make git package if different than the remote
- |
if [ ! "$SHA_STRIP_LOCAL" == "$SHA_STRIP_REMOTE" ]; then
cd ../ffsend-git
echo "Making git source package..."
sudo -u nobody makepkg -c
sudo -u nobody makepkg --printsrcinfo > .SRCINFO
else
echo "Not making git source package, it has not changed"
fi
- cd ..
# Set up SSH for publishing
# Set up SSH for publishing
- mkdir -p /root/.ssh
- cp ./aur.pub /root/.ssh/id_rsa.pub
- echo "$AUR_SSH_PRIVATE" > /root/.ssh/id_rsa
@ -261,22 +355,37 @@ package-aur:
- git config --global user.name "timvisee"
- git config --global user.email "tim@visee.me"
# Publish binary package: clone AUR repo, commit update and push
- git clone ssh://aur@aur.archlinux.org/ffsend.git aur-ffsend-bin
- cd aur-ffsend-bin
- cp ../bin/{PKGBUILD,.SRCINFO} ./
# Publish main package: clone AUR repo, commit update and push
- git clone ssh://aur@aur.archlinux.org/ffsend.git aur-ffsend
- cd aur-ffsend
- cp ../ffsend/{PKGBUILD,.SRCINFO} ./
- git add PKGBUILD .SRCINFO
- git commit -m "Release v$VERSION"
- git push
- cd ..
# Publish git package: clone AUR repo, commit update and push
- git clone ssh://aur@aur.archlinux.org/ffsend-git.git aur-ffsend-git
- cd aur-ffsend-git
- cp ../git/{PKGBUILD,.SRCINFO} ./
# Publish binary package: clone AUR repo, commit update and push
- git clone ssh://aur@aur.archlinux.org/ffsend-bin.git aur-ffsend-bin
- cd aur-ffsend-bin
- cp ../ffsend-bin/{PKGBUILD,.SRCINFO} ./
- git add PKGBUILD .SRCINFO
- git commit -m "Release v$VERSION"
- git push
- cd ..
# Publish git package: clone AUR repo, commit update and push
# Only publish it if it is different than the remote
- |
if [ ! "$SHA_STRIP_LOCAL" == "$SHA_STRIP_REMOTE" ]; then
git clone ssh://aur@aur.archlinux.org/ffsend-git.git aur-ffsend-git
cd aur-ffsend-git
cp ../ffsend-git/{PKGBUILD,.SRCINFO} ./
git add PKGBUILD .SRCINFO
git commit -m "Update PKGBUILD for release v$VERSION"
git push
cd ..
else
echo "Not pushing git package, it has not changed"
fi
# TODO: add job to test ffsend{-git} AUR packages

View file

@ -10,13 +10,6 @@ stages:
- name: release
if: tag =~ ^v(\d+\.)*\d+$
# Explicitly install and update OpenSSL dependencies
addons:
homebrew:
packages:
- openssl@1.1
update: true
jobs:
include:
- stage: release
@ -38,3 +31,11 @@ jobs:
# Create the release, upload binary
- ./github-release release --token "$GITHUB_TOKEN" --owner timvisee --repo ffsend --tag "$TRAVIS_TAG" --title "ffsend $TRAVIS_TAG"
- ./github-release upload --token "$GITHUB_TOKEN" --owner timvisee --repo ffsend --tag "$TRAVIS_TAG" --file ./ffsend --name ffsend-$TRAVIS_TAG-macos
# TODO: disabled for now to throttle updates, manually enable on major release
# # Update homebrew package
# - git config --global user.name "timvisee"
# - git config --global user.email "$GIT_EMAIL"
# - git config --global credential.helper store
# - echo "https://timvisee:$HOMEBREW_GITHUB_API_TOKEN@github.com" >> ~/.git-credentials
# - brew bump-formula-pr --url="https://github.com/timvisee/ffsend/archive/$TRAVIS_TAG.tar.gz" --message="Automated release pull request using continuous integration." --no-browse -f -v ffsend

132
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,132 @@
# Contributing
**Repository:**
- [GitLab repository][gitlab]
- _Mirror: [GitHub repository][github]_
**Issues:** (bug reporting, feature requests, enhancements, etc.)
- [GitLab issue board][gitlab-issues]
- _Alternatively: [GitHub issue board][github-issues]_
**Pull/merge requests:** (fixes, implemented features, etc.)
- [GitLab merge requests][gitlab-mr]
- _Alternatively: [GitHub pull requests][github-pr]_
Contributions to the `ffsend` project are welcome!
When contributing new features, alternative implementations or bigger
improvements, please first discuss the change you wish to make via an issue
or email.
Small changes such as fixed commands, fixed spelling or dependency updates
are always welcome without discussion.
The `ffsend` repository is primarily hosted on [GitLab][gitlab].
[GitHub][github] hosts a mirror, for publicity and findability.
Please open any issues or pull requests on the [GitLab][gitlab] pages if possible.
Otherwise opening these on [GitHub][github] is fine, though they might be
manually moved over to [GitLab][gitlab].
Please note we have a code of conduct, please follow it in all your interactions
with the project.
## Pull Request Process
1. Ensure you've discussed your improvements in an issue when working on a
bigger change
2. Ensure your branch is up-to-date with the latest [`master`][branch-master]
3. Ensure the project builds with your changes: `cargo build`
4. Ensure the project tests succeed with your changes: `cargo test`
5. Update the `README.md` with details of significant changes, this includes new
compiler features, command-line arguments, environment variables or new
package installation instructions.
6. Submit your pull request.
7. Fix any issues continuous integration might report.
Additional notes:
- Do not change version numbers, this is done by @timvisee
## Code of Conduct
### Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
### Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
### Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
### Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project owner at 3a4fb3964f@sinenomine.email. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
### Attribution
This Code of Conduct is adapted from the [Contributor Covenant][coc-homepage], version 1.4,
available at [https://contributor-covenant.org/version/1/4][coc-version]
## License
This project is released under the GNU GPL-3.0 license.
Check out the [LICENSE](LICENSE) file for more information.
[branch-master]: https://gitlab.com/timvisee/ffsend/tree/master
[gitlab]: https://gitlab.com/timvisee/ffsend
[gitlab-issues]: https://gitlab.com/timvisee/ffsend/issues
[gitlab-mr]: https://gitlab.com/timvisee/ffsend/merge_requests
[github]: https://github.com/timvisee/ffsend
[github-issues]: https://github.com/timvisee/ffsend/issues
[github-pr]: https://github.com/timvisee/ffsend/pulls
[coc-homepage]: https://contributor-covenant.org
[coc-version]: https://contributor-covenant.org/version/1/4/

3269
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,14 +1,15 @@
[package]
name = "ffsend"
version = "0.2.29"
authors = ["Tim Visee <timvisee@gmail.com>"]
version = "0.2.76"
rust-version = "1.63.0"
authors = ["Tim Visee <3a4fb3964f@sinenomine.email>"]
license = "GPL-3.0"
readme = "README.md"
homepage = "https://gitlab.com/timvisee/ffsend"
homepage = "https://timvisee.com/projects/ffsend"
repository = "https://gitlab.com/timvisee/ffsend"
description = """\
Easily and securely share files from the command line.\n\
A fully featured Firefox Send client.\
A fully featured Send client.\
"""
keywords = ["send", "firefox", "cli"]
categories = [
@ -19,9 +20,16 @@ categories = [
"network-programming",
]
exclude = [
"res/*",
"/.github",
"/contrib",
"/pkg",
"/res",
"/*.yml",
"/CONTRIBUTING.md",
"/SECURITY.md",
]
edition = "2018"
build = "build.rs"
[package.metadata.deb]
section = "utility"
@ -42,53 +50,86 @@ license-file = ["LICENSE", "3"]
depends = "$auto, libssl1.1, ca-certificates, xclip"
maintainer-scripts = "pkg/deb"
[badges]
gitlab = { repository = "timvisee/ffsend", branch = "master" }
[[bin]]
name = "ffsend"
path = "src/main.rs"
[features]
default = ["archive", "clipboard", "history", "send2", "send3"]
default = ["archive", "clipboard", "crypto-ring", "history", "infer-command", "qrcode", "send3", "urlshorten"]
# Compile with file archiving support
archive = ["tar"]
# Support for putting share URLs in clipboard
clipboard = ["clip", "which"]
# Compile with file history support
history = []
# Support for Send v2
send2 = ["ffsend-api/send2"]
# Support for Send v3
send3 = ["ffsend-api/send3"]
# Use OpenSSL as cryptography backend
crypto-openssl = ["ffsend-api/crypto-openssl"]
# Use ring as cryptography backend
crypto-ring = ["ffsend-api/crypto-ring"]
# Support for generating QR codes for share URLs
qrcode = ["qr2term"]
# Support for shortening share URLs
urlshorten = ["urlshortener"]
# Support for inferring subcommand when linking binary
infer-command = []
# Compile without colored output support
no-color = ["colored/no-color"]
# Support for Firefox Send v2
send2 = ["ffsend-api/send2"]
# Automatic using build.rs: use xclip/xsel binary method for clipboard support
clipboard-bin = ["clipboard"]
# Support for Firefox Send v3
send3 = ["ffsend-api/send3"]
# Automatic using build.rs: use native clipboard crate for clipboard support
clipboard-crate = ["clipboard"]
[dependencies]
chbs = "0.0.8"
chbs = "0.1.0"
chrono = "0.4"
clap = "2.31"
colored = "1.7"
derive_builder = "0.7"
directories = "1.0"
clap = "2.33"
colored = "2.0"
derive_builder = "0.10"
directories = "4.0"
failure = "0.1"
ffsend-api = { version = "0.2.3", default-features = false }
ffsend-api = { version = "0.7.3", default-features = false }
fs2 = "0.4"
lazy_static = "1.0"
open = "1"
lazy_static = "1.4"
open = "2"
openssl-probe = "0.1"
pathdiff = "0.2"
pbr = "1"
prettytable-rs = "0.8"
rpassword = "2.1"
serde = "1.0"
serde_derive = "1.0"
prettytable-rs = { version = "0.10.0", default-features = false }
qr2term = { version = "0.2", optional = true }
rand = "0.8"
regex = "1.5"
rpassword = "5"
serde = "1"
serde_derive = "1"
tar = { version = "0.4", optional = true }
tempfile = "3"
toml = "0.4"
version-compare = "0.0.6"
toml = "0.5"
urlshortener = { version = "3", optional = true }
version-compare = "0.1"
[target.'cfg(not(target_os = "linux"))'.dependencies]
clipboard = { version = "0.5", optional = true }
[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd", target_os = "netbsd"))'.dependencies]
which = { version = "4.0", optional = true }
[target.'cfg(not(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd", target_os = "netbsd")))'.dependencies]
# Aliased to clip to prevent name collision with clipboard feature
clip = { version = "0.5", optional = true, package = "clipboard" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View file

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2018 Tim Visee. <https://timvisee.com/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.

584
README.md
View file

@ -1,23 +1,26 @@
[![Build status on GitLab CI][gitlab-ci-master-badge]][gitlab-ci-link]
[![Newest release on crates.io][crate-version-badge]][crate-link]
[![Number of downloads on crates.io][crate-download-badge]][crate-link]
[![Project license][crate-license-badge]](LICENSE)
[crate-download-badge]: https://img.shields.io/crates/d/ffsend.svg
[crate-license-badge]: https://img.shields.io/crates/l/ffsend.svg
[crate-link]: https://crates.io/crates/ffsend
[crate-version-badge]: https://img.shields.io/crates/v/ffsend.svg
[gitlab-ci-link]: https://gitlab.com/timvisee/ffsend/pipelines
[gitlab-ci-master-badge]: https://gitlab.com/timvisee/ffsend/badges/master/pipeline.svg
# ffsend [WIP]
*Notice: the default Send host is provided by [@timvisee][timvisee]
([info](https://gitlab.com/timvisee/ffsend/-/issues/111)).
Please consider to [donate] and help keep it running.*
# ffsend
> Easily and securely share files from the command line.
> A fully featured [Firefox Send][send] client.
> A [Send][send] client.
Easily and securely share files and directories from the command line through a
safe, private and encrypted link using a single simple command.
Files are shared using the [Send][send] service and may be up
to 2GB. Others are able to download these files with this tool, or through
to 1GB. Others are able to download these files with this tool, or through
their web browser.
[![ffsend usage demo][usage-demo-svg]][usage-demo-asciinema]
@ -33,7 +36,7 @@ Find out more about security [here](#security).
- [Features](#features)
- [Usage](#usage)
- [Requirements](#requirements)
- [Install](#install) ([Linux](#linux-all-distributions), [macOS](#macos), [Windows](#windows), [_Other OS/arch_](#other-os-or-architecture))
- [Install](#install) ([Linux](#linux-all-distributions), [macOS](#macos), [Windows](#windows), [FreeBSD](#freebsd), [Android](#android), [_Other OS/arch_](#other-os-or-architecture))
- [Build](#build)
- [Configuration and environment](#configuration-and-environment)
- [Security](#security)
@ -42,26 +45,25 @@ Find out more about security [here](#security).
- [License](#license)
The public [Send][send] service that is used as default host is provided by
[Mozilla][mozilla].
This application is not affiliated with [Mozilla][mozilla], [Firefox][firefox]
or [Firefox Send][send] in any way.
[@timvisee][timvisee] ([info](https://gitlab.com/timvisee/ffsend/-/issues/111)).
This application is not affiliated with [Firefox][firefox] or
[Mozilla][mozilla] in any way.
_Note: this tool is currently in alpha_
_Note: this tool is currently in beta, as some extra desired features are yet to be implemented_
## Features
- Fully featured and friendly command line tool
- Upload and download files and directories securely
- Always encrypted on the client
- Upload and download files and directories securely, always encrypted on the client
- Additional password protection, generation and configurable download limits
- Supports old and new Firefox Send server versions
- File and directory archiving and extraction
- Built-in share URL shortener and QR code generator
- Supports Send v3 (current) and v2
- History tracking your files for easy management
- Ability to use custom Send hosts
- Ability to use your own Send hosts
- Inspect or delete shared files
- Accurate error reporting
- Streaming encryption and uploading/downloading, very low memory footprint
- Intended for use in scripts without interaction
- Upcomming: Firefox Account integration (higher download counts, longer expiry times)
- Intended for use in [scripts](#scriptability) without interaction
For a list of upcoming features and ideas, take a look at the
current [open issues](https://gitlab.com/timvisee/ffsend/issues) over on GitLab.
@ -72,35 +74,36 @@ Easily upload and download:
```bash
# Simple upload
$ ffsend upload my-file.txt
Share link: https://send.firefox.com/#sample-share-url
https://send.vis.ee/#sample-share-url
# Advanced upload
# - Specify a download limit of 20
# - Specify a download limit of 1
# - Specify upload expiry time of 5 minutes
# - Enter a password to encrypt the file
# - Archive the file before uploading
# - Copy the shareable link to your clipboard
# - Open the shareable link in your browser
$ ffsend upload --downloads 20 --password --archive --copy --open my-file.txt
$ ffsend upload --downloads 1 --expiry-time 5m --password --archive --copy --open my-file.txt
Password: ******
Share link: https://send.firefox.com/#sample-share-url
https://send.vis.ee/#sample-share-url
# Upload to your own host
$ ffsend u -h https://example.com/ my-file.txt
Share link: https://example.com/#sample-share-url
https://example.com/#sample-share-url
# Simple download
$ ffsend download https://send.firefox.com/#sample-share-url
$ ffsend download https://send.vis.ee/#sample-share-url
```
Inspect remote files:
```bash
# Check if a file exists
$ ffsend exists https://send.firefox.com/#sample-share-url
$ ffsend exists https://send.vis.ee/#sample-share-url
Exists: yes
# Fetch remote file info
$ ffsend info https://send.firefox.com/#sample-share-url
$ ffsend info https://send.vis.ee/#sample-share-url
ID: b087066715
Name: my-file.txt
Size: 12 KiB
@ -110,55 +113,61 @@ Expiry: 18h2m (64928s)
```
Other commands include:
```bash
# View your file history
$ ffsend history
# LINK EXPIRY OWNER TOKEN
1 https://send.firefox.com/#sample-share-url 23h57m eea9f544f6d5df8a5afd
2 https://send.firefox.com/#other-sample-url 17h38m 1e9fef63fee3baaf54ce
3 https://example.com/#sample-share-url 37m30s 8eb28bc1bc85cfdab0e4
# LINK EXPIRE
1 https://send.vis.ee/#sample-share-url 23h57m
2 https://send.vis.ee/#other-sample-url 17h38m
3 https://example.com/#sample-share-url 37m30s
# Change the password after uploading
$ ffsend password https://send.firefox.com/#sample-share-url
$ ffsend password https://send.vis.ee/#sample-share-url
Password: ******
# Delete a file
$ ffsend delete https://send.firefox.com/#sample-share-url
$ ffsend delete https://send.vis.ee/#sample-share-url
```
Use the `--help` flag, `help` subcommand, or see the [help](#help) section for
all available subcommands.
## Requirements
- Linux, Windows or macOS
- Linux, macOS, Windows, FreeBSD, Android (other BSDs might work)
- A terminal :sunglasses:
- Internet connection for uploading and downloading
- Linux specific:
- Internet connection
- Linux:
- OpenSSL & CA certificates:
- Ubuntu, Debian and derivatives: `apt install openssl ca-certificates`
- Optional: `xclip` for clipboard support
- Optional: `xclip` or `xsel` for clipboard support
- Ubuntu, Debian and derivatives: `apt install xclip`
- CentOS/Red Hat/openSUSE/Fedora: `yum install xclip`
- Arch: `pacman -S xclip`
- Windows specific:
- OpenSSL v1.1.0j: [» Installer][openssl-windows-installer]
- Optional OpenSSL with `crypto-openssl` feature: [» Installer][openssl-windows-installer] (`v1.1.0j` or above)
- macOS specific:
- OpenSSL: `brew install openssl@1.1`
- Optional OpenSSL with `crypto-openssl` feature: `brew install openssl@1.1`
- FreeBSD specific:
- OpenSSL: `pkg install openssl`
- CA certificates: `pkg install ca_root_nss`
- Optional `xclip` & `xsel` for clipboard support: `pkg install xclip xsel-conrad`
- Android specific:
- Termux: [» Termux][termux]
## Install
<!-- Before installing, make sure you meet all requirements listed
[here](#requirements) -->
Because `ffsend` is still in alpha, only limited installation options are
available right now.
Because `ffsend` is still in early stages, only limited installation options are
available right now. Feel free to contribute additional packages.
Make sure you meet and install the [requirements](#requirements).
See the operating system specific instructions below:
* [Linux](#linux-all-distributions)
* [macOS](#macos)
* [Windows](#windows)
* [_Other OS or architecture_](#other-os-or-architecture)
- [Linux](#linux-all-distributions)
- [macOS](#macos)
- [Windows](#windows)
- [FreeBSD](#freebsd)
- [Android](#android)
- [_Other OS or architecture_](#other-os-or-architecture)
### Linux (all distributions)
Using the [snap](#linux-snap-package) package is recommended if supported.
@ -172,26 +181,69 @@ More packages options will be coming soon.
#### Linux: snap package
_Note: The `ffsend` `snap` package is isolated, and can only access files in
your home directory. Use a different installation option instead if you don't
want this._
your home directory. Choose a different installation option if you don't want
this limitation._
_Note: due to how `snap` is configured by default, you won't be able to use the
package from some contexts such as through SSH without manual modifications. If
you're experiencing problems, please refer to a different installation method
such as the [prebuilt binaries](#linux-prebuilt-binaries), or open an issue._
`ffsend`][snapcraft-ffsend]
```bash
snap install ffsend
ffsend --help
```
#### Linux: Arch AUR packages
`ffsend`][aur-ffsend] (binary package)
`ffsend-git`][aur-ffsend-git] (compile from source package)
`ffsend-bin`][aur-ffsend-bin] (precompiled binary, latest release, recommended)
`ffsend`][aur-ffsend] (compiles from source, latest release)
`ffsend-git`][aur-ffsend-git] (compiles from source, latest `master` commit)
```bash
yaourt -S ffsend
yay -S ffsend
# or
yay ffsend
# or
aurget -S ffsend
# or using any other AUR installer
aurto add ffsend-bin
sudo pacman -S ffsend-bin
# or using any other AUR helper
ffsend --help
```
#### Linux: Nix package
_Note: The Nix package is currently not automatically updated, and might be
slightly outdated._
[» ffsend][nix-ffsend]
```bash
nix-channel --update
nix-env --install ffsend
ffsend --help
```
#### Linux: Fedora package
_Note: The Fedora package is maintained by contributors, and might be
slightly outdated._
[» ffsend][fedora-ffsend]
```bash
sudo dnf install ffsend
ffsend --help
```
#### Linux: Alpine package
_Note: The Alpine package is maintained by contributors, it might be outdated.
Choose a different installation method if an important update is missing._
[» ffsend][alpine-ffsend]
```bash
apk add ffsend --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
ffsend --help
```
@ -199,6 +251,8 @@ ffsend --help
#### Linux: Prebuilt binaries
Check out the [latest release][github-latest-release] assets for Linux binaries.
Use the `ffsend-v*-linux-x64-static` binary, to minimize the chance for issues.
If it isn't available yet, you may use an artifact from a
[previous version][github-releases] instead, until it is available.
Make sure you meet and install the [requirements](#requirements) before you
continue.
@ -214,30 +268,56 @@ mv ./ffsend-* ./ffsend
chmod a+x ./ffsend
# Move binary into path, to make it easily usable
sudo mv ./ffsend /usr/bin/
sudo mv ./ffsend /usr/local/bin/
ffsend --help
```
### macOS
Currently only a [prebuilt binary](#macos-prebuilt-binaries) is available for macOS.
Using the [`homebrew` package](#macos-homebrew-package) is recommended.
Alternatively you may install it via [MacPorts](#macos-macports), or manually using the
[prebuilt binaries](#macos-prebuilt-binaries).
A `homebrew` package will be coming soon.
#### macOS: homebrew package
Make sure you've [`homebrew`][homebrew] installed, and run:
```bash
brew install ffsend
ffsend --help
```
#### macOS: MacPorts
_Note: ffsend in MacPorts is currently not automatically updated, and might be
slightly outdated._
Once you have [MacPorts](https://www.macports.org) installed, you can run:
```bash
sudo port selfupdate
sudo port install ffsend
```
#### macOS: Nix package
_Note: The Nix package is currently not automatically updated, and might be
slightly outdated._
```bash
nix-channel --update
nix-env --install ffsend
ffsend --help
```
#### macOS: Prebuilt binaries
Check out the [latest release][github-latest-release] assets for a macOS binary.
If it isn't available yet, you may use an artifact from a
[previous version][github-releases] instead, until it is available.
You must install `openssl` through [`homebrew`][homebrew] which `ffsend` depends
on.
Then, mark the downloaded binary as as executable.
You then may want to move it into `/usr/bin/` to make the `ffsend` command
Then, mark the downloaded binary as an executable.
You then may want to move it into `/usr/local/bin/` to make the `ffsend` command
globally available:
```bash
# Install openssl dependency
brew install openssl@1.1
# Rename file to ffsend
mv ./ffsend-* ./ffsend
@ -245,13 +325,15 @@ mv ./ffsend-* ./ffsend
chmod a+x ./ffsend
# Move binary into path, to make it easily usable
sudo mv ./ffsend /usr/bin/
sudo mv ./ffsend /usr/local/bin/
ffsend
```
### Windows
Currently only [prebuilt binaries](#windows-prebuilt-binaries) are available for Windows.
Using the [`scoop` package](#windows-scoop-package) is recommended.
Alternatively you may install it manually using the
[prebuilt binaries](#windows-prebuilt-binaries).
If you're using the [Windows Subsystem for Linux][wsl], it's highly recommended
to install the [prebuilt Linux binary](#prebuilt-binaries-for-linux) instead.
@ -259,110 +341,188 @@ to install the [prebuilt Linux binary](#prebuilt-binaries-for-linux) instead.
Only 64-bit (`x86_64`) binaries are provided.
For other architectures and configurations you may [compile from source](#build).
A `chocolatey` and a `scoop` package along with an `.msi` installer will be coming soon.
A `chocolatey` package along with an `.msi` installer will be coming soon.
#### Windows: scoop package
Make sure you've [`scoop`][scoop-install] installed, and run:
```bash
scoop install ffsend
ffsend --help
```
#### Windows: Prebuilt binaries
Check out the [latest release][github-latest-release] assets for Windows binaries.
Use the `ffsend-v*-windows-x64-static` binary, to minimize the chance for issues.
You must install OpenSSL 1.1.0j which `ffsend` depends on. The installer for
this can be found here: [» Installer][openssl-windows-installer]
If it isn't available yet, you may use an artifact from a
[previous version][github-releases] instead, until it is available.
You can use `ffsend` from the command line in the same directory:
```cmd
.\ffsend.exe --help
```
To make it globally invokable as `ffsend`, you must make the binary available in
To make it globally invocable as `ffsend`, you must make the binary available in
your systems `PATH`. The easiest solution is to move it into `System32`:
```cmd
move .\ffsend.exe C:\Windows\System32\ffsend.exe
```
### FreeBSD
`ffsend`][freshports-ffsend]
_Note: The FreeBSD package is currently maintained by FreeBSD contributors,
and might be slightly outdated._
```sh
# Precompiled binary.
pkg install ffsend
# Compiles and installs from source.
cd /usr/ports/www/ffsend && make install
```
### Android
`ffsend` can be used on Android through Termux, install it first:
[» Termux][termux]
_Note: The Android package is currently maintained by Termux contributors,
and might be slightly outdated._
```sh
# Install package.
pkg install ffsend
ffsend help
```
### Other OS or architecture
If your system runs Docker, you can use the [docker image](#docker-image).
There are currently no other binaries or packages available.
You can [build the project from source](#build) instead.
#### Docker image
A Docker image is available for using `ffsend` running in a container.
Mount a directory to `/data`, so it's accessible for `ffsend` in the container,
and use the command as you normally would.
`timvisee/ffsend`][docker-hub-ffsend]
```bash
# Invoke without arguments
docker run --rm -it -v $(pwd):/data timvisee/ffsend
# Upload my-file.txt
docker run --rm -it -v $(pwd):/data timvisee/ffsend upload my-file.txt
# Download from specified link
docker run --rm -it -v $(pwd):/data timvisee/ffsend download https://send.vis.ee/#sample-share-url
# Show help
docker run --rm -it -v $(pwd):/data timvisee/ffsend help
# To update the used image
docker pull timvisee/ffsend
```
On Linux or macOS you might define a alias in your shell configuration, to make
it invocable as `ffsend`:
```bash
alias ffsend='docker run --rm -it -v "$(pwd):/data" timvisee/ffsend'
```
_Note: This implementation is limited to accessing the paths you make available
through the specified mount._
## Build
To build and install `ffsend` yourself, you meet the following requirements
before proceeding:
### Build requirements
- Regular [requirements](#requirements)
- Runtime [requirements](#requirements)
- [`git`][git]
- [`rust`][rust] `v1.32` or higher (install using [`rustup`][rustup])
- [OpenSSL][openssl] or [LibreSSL][libressl] libraries and headers must be available
- Linux:
- Ubuntu, Debian and derivatives: `apt install build-essential cmake pkg-config libssl-dev`
- CentOS/Red Hat/openSUSE: `yum install gcc gcc-c++ make cmake openssl-devel`
- Arch: `pacman -S openssl base-devel`
- [`rust`][rust] `v1.63` (MSRV) or higher (install using [`rustup`][rustup])
- [OpenSSL][openssl] or [LibreSSL][libressl] libraries/headers:
- Linux:
- Ubuntu, Debian and derivatives: `apt install build-essential cmake pkg-config libssl-dev`
- CentOS/Red Hat/openSUSE: `yum install gcc gcc-c++ make cmake openssl-devel`
- Arch: `pacman -S openssl base-devel`
- Gentoo: `emerge -a dev-util/pkgconfig dev-util/cmake dev-libs/openssl`
- Fedora: `dnf install gcc gcc-c++ make cmake openssl-devel`
- Or see instructions [here](https://github.com/sfackler/rust-openssl#linux)
- Windows:
- See instructions here [here](https://github.com/sfackler/rust-openssl#windows-msvc)
- macOS:
- Using `brew`: `brew install cmake pkg-config openssl`
- Or see instructions [here](https://github.com/sfackler/rust-openssl#osx)
- Fedora: `dnf install gcc gcc-c++ make cmake openssl-devel`
- Or see instructions [here](https://github.com/sfackler/rust-openssl#linux)
- Windows:
- Optional with `crypto-openssl` feature: See instructions here [here](https://github.com/sfackler/rust-openssl#windows-msvc)
- macOS:
- Optional with `crypto-openssl` feature: `brew install cmake pkg-config openssl` or see instructions [here](https://github.com/sfackler/rust-openssl#osx)
- FreeBSD:
- `pkg install rust gmake pkgconf python36 libxcb xclip ca_root_nss xsel-conrad`
- It is a better idea to use & modify the existing `ffsend` port, which manages dependencies for you.
### Compile and install
Then, walk through one of the following steps to compile and install `ffsend`:
- Compile and install it directly from cargo:
```bash
# Compile and install from cargo
cargo install ffsend -f
```bash
# Compile and install from cargo
cargo install ffsend -f
# Start using ffsend
ffsend --help
```
# Start using ffsend
ffsend --help
```
- Or clone the repository and install it with `cargo`:
```bash
# Clone the project
git clone https://github.com/timvisee/ffsend.git
cd ffsend
```bash
# Clone the project
git clone https://github.com/timvisee/ffsend.git
cd ffsend
# Compile and install
cargo install -f
# Compile and install
cargo install --path . -f
# Start using ffsend
ffsend --help
# Start using ffsend
ffsend --help
# or run it directly from cargo
cargo run --release -- --help
```
# or run it directly from cargo
cargo run --release -- --help
```
- Or clone the repository and invoke the binary directly (Linux/macOS):
```bash
# Clone the project
git clone https://github.com/timvisee/ffsend.git
cd ffsend
```bash
# Clone the project
git clone https://github.com/timvisee/ffsend.git
cd ffsend
# Build the project (release version)
cargo build --release
# Build the project (release version)
cargo build --release
# Start using ffsend
./target/release/ffsend --help
```
# Start using ffsend
./target/release/ffsend --help
```
### Compile features / use flags
Different use flags are available for `ffsend` to toggle whether to include
various features.
The following features are available, some of which are enabled by default:
| Feature | Enabled | Description |
| :---------: | :-----: | :--------------------------------------------------------- |
| `send2` | Default | Support for Firefox Send v2 servers |
| `send3` | Default | Support for Firefox Send v3 servers |
| `clipboard` | Default | Support for copying links to the clipboard |
| `history` | Default | Support for tracking files in history |
| `archive` | Default | Support for archiving and extracting uploads and downloads |
| `no-color` | | Compile without color support in error and help messages |
| Feature | Enabled | Description |
| :-------------: | :-----: | :--------------------------------------------------------- |
| `send2` | Default | Support for Send v2 servers |
| `send3` | Default | Support for Send v3 servers |
| `crypto-ring` | Default | Use ring as cryptography backend |
| `crypto-openssl`| | Use OpenSSL as cryptography backend |
| `clipboard` | Default | Support for copying links to the clipboard |
| `history` | Default | Support for tracking files in history |
| `archive` | Default | Support for archiving and extracting uploads and downloads |
| `qrcode` | Default | Support for rendering a QR code for a share URL |
| `urlshorten` | Default | Support for shortening share URLs |
| `infer-command` | Default | Support for inferring subcommand based on binary name |
| `no-color` | | Compile without color support in error and help messages |
To enable features during building or installation, specify them with
`--features <features...>` when using `cargo`.
@ -375,11 +535,11 @@ Here are some examples:
cargo install --features no-color
cargo build --release --features no-color
# None of the features
cargo install --no-default-features
# No default features, except required
cargo install --no-default-features --features send3,crypto-ring
# Only history and clipboard support
cargo install --no-default--features --features history,clipboard
# With history and clipboard support
cargo install --no-default--features --features send3,crypto-ring,history,clipboard
```
For Windows systems it is recommended to provide the `no-color` flag, as color
@ -390,13 +550,16 @@ The following environment variables may be used to configure the following
defaults. The CLI flag is shown along with it, to better describe the relation
to command line arguments:
| Variable | CLI flag | Description |
| :------------------------ | :----------------------------: | :-------------------------------- |
| `FFSEND_HISTORY` | `--history <FILE>` | History file path |
| `FFSEND_HOST` | `--host <URL>` | Upload host |
| `FFSEND_TIMEOUT` | `--timeout <SECONDS>` | Request timeout (0 to disable) |
| `FFSEND_TRANSFER_TIMEOUT` | `--transfer-timeout <SECONDS>` | Transfer timeout (0 to disable) |
| `FFSEND_API` | `--api <VERSION>` | Server API version, `-` to lookup |
| Variable | CLI flag | Description |
| :------------------------ | :----------------------------: | :-------------------------------------------- |
| `FFSEND_HISTORY` | `--history <FILE>` | History file path |
| `FFSEND_HOST` | `--host <URL>` | Upload host |
| `FFSEND_TIMEOUT` | `--timeout <SECONDS>` | Request timeout (0 to disable) |
| `FFSEND_TRANSFER_TIMEOUT` | `--transfer-timeout <SECONDS>` | Transfer timeout (0 to disable) |
| `FFSEND_EXPIRY_TIME` | `--expiry-time <SECONDS>` | Default upload expiry time |
| `FFSEND_DOWNLOAD_LIMIT` | `--download-limit <DOWNLOADS>` | Default download limit |
| `FFSEND_API` | `--api <VERSION>` | Server API version, `-` to lookup |
| `FFSEND_BASIC_AUTH` | `--basic-auth <USER:PASSWORD>` | Basic HTTP authentication credentials to use. |
These environment variables may be used to toggle a flag, simply by making them
available. The actual value of these variables is ignored, and variables may be
@ -416,13 +579,128 @@ empty.
| `FFSEND_QUIET` | `--quiet` | Log quiet information |
| `FFSEND_VERBOSE` | `--verbose` | Log verbose information |
Some environment variables may be set at compile time to tweak some defaults.
| Variable | Description |
| :----------- | :------------------------------------------------------------------------- |
| `XCLIP_PATH` | Set fixed `xclip` binary path when using `clipboard-bin` (Linux, &ast;BSD) |
| `XSEL_PATH` | Set fixed `xsel` binary path when using `clipboard-bin` (Linux, &ast;BSD) |
At this time, no configuration or _dotfile_ file support is available.
This will be something added in a later release.
### Binary for each subcommand: `ffput`, `ffget`
`ffsend` supports having a separate binaries for single subcommands, such as
having `ffput` and `ffget` just for to upload and download using `ffsend`.
This allows simple and direct commands like:
```bash
ffput my-file.txt
ffget https://send.vis.ee/#sample-share-url
```
This works for a predefined list of binary names:
- `ffput``ffsend upload ...`
- `ffget``ffsend download ...`
- `ffdel``ffsend delete ...`
- _This list is defined in [`src/config.rs`](./src/config.rs) as `INFER_COMMANDS`_
You can use the following methods to set up these single-command binaries:
- Create a properly named symbolic link (recommended)
- Create a properly named hard link
- Clone the `ffsend` binary, and rename it
On Linux and macOS you can use the following command to set up symbolic links in
the current directory:
```bash
ln -s $(which ffsend) ./ffput
ln -s $(which ffsend) ./ffget
```
Support for this feature is only available when `ffsend` is compiled with the
[`infer-command`](#compile-features--use-flags) feature flag.
This is usually enabled by default.
To verify support is available with an existing installation, make sure the
feature is listed when invoking `ffsend debug`.
Note that the `snap` package does currently not support this due to how this
package format works.
### Scriptability
`ffsend` is optimized for use in automated scripts. It provides some specialized
arguments to control `ffsend` without user interaction.
- `--no-interact` (`-I`): do not allow user interaction. For prompts not having
a default value, the application will quit with an error, unless `--yes`
or `--force` is provided.
This should **always** be given when using automated scripting.
Example: when uploading a directory, providing this flag will stop the
archive question prompt form popping up, and will archive the directory as
default option.
- `--yes` (`-y`): assume the yes option for yes/no prompt by default.
Example: when downloading a file that already exists, providing this flag
will assume yes when asking to overwrite a file.
- `--force` (`-f`): force to continue with the action, skips any warnings that
would otherwise quit the application.
Example: when uploading a file that is too big, providing this flag will
ignore the file size warning and forcefully continues.
- `--quiet` (`-q`): be quiet, print as little information as possible.
Example: when uploading a file, providing this flag will only output the
final share URL.
Generally speaking, use the following rules when automating:
- Always provide `--no-interact` (`-I`).
- Provide any combination of `--yes` (`-y`) and `--force` (`-f`) for actions you
want to complete no matter what.
- When passing share URLs along, provide the `--quiet` (`-q`) flag, when
uploading for example.
These flags can also automatically be set by defining environment variables as
specified here:
[» Configuration and environment](#configuration-and-environment)
Here are some examples commands in `bash`:
```bash
# Stop on error
set -e
# Upload a file
# -I: no interaction
# -y: assume yes
# -q: quiet output, just return the share link
URL=$(ffsend -Iy upload -q my-file.txt)
# Render file information
# -I: no interaction
# -f: force, just show the info
ffsend -If info $URL
# Set a password for the uploaded file
ffsend -I password $URL --password="secret"
# Use the following flags automatically from now on
# -I: no interaction
# -f: force
# -y: yes
export FFSEND_NO_INTERACT=1 FFSEND_FORCE=1 FFSEND_YES=1
# Download the uploaded file, overwriting the local variant due to variables
ffsend download $URL --password="secret"
```
For more information on these arguments, invoke `ffsend help` and check out:
[» Configuration and environment](#configuration-and-environment)
For other questions regarding automation or feature requests, be sure to
[open](https://github.com/timvisee/ffsend/issues/) an issue.
## Security
In short; the `ffsend` tool and the [Send][send] service can be considered
secure, and may be used to share sensitive files. Note though that the
created share link for an upload will allow anyone to download the file.
created share link for an upload will allow anyone to download the file.
Make sure you don't share this link with unauthorized people.
For more detailed information on encryption, please read the rest of the
@ -466,10 +744,13 @@ documentation [here][send-encryption].
```
$ ffsend help
ffsend 0.2.29
Tim Visee <timvisee.com>
ffsend 0.2.72
Tim Visee <3a4fb3964f@sinenomine.email>
Easily and securely share files from the command line.
A fully featured Firefox Send client.
A fully featured Send client.
The default public Send host is provided by Tim Visee, @timvisee.
Please consider to donate and help keep it running: https://vis.ee/donate
USAGE:
ffsend [FLAGS] [OPTIONS] [SUBCOMMAND]
@ -485,6 +766,8 @@ FLAGS:
-y, --yes Assume yes for prompts
OPTIONS:
-A, --api <VERSION> Server API version to use, '-' to lookup [env: FFSEND_API]
--basic-auth <USER:PASSWORD> Protected proxy HTTP basic authentication credentials (not FxA) [env: FFSEND_BASIC_AUTH]
-H, --history <FILE> Use the specified history file [env: FFSEND_HISTORY]
-t, --timeout <SECONDS> Request timeout (0 to disable) [env: FFSEND_TIMEOUT]
-T, --transfer-timeout <SECONDS> Transfer timeout (0 to disable) [env: FFSEND_TRANSFER_TIMEOUT]
@ -493,8 +776,9 @@ SUBCOMMANDS:
upload Upload files [aliases: u, up]
download Download files [aliases: d, down]
debug View debug information [aliases: dbg]
delete Delete a shared file [aliases: del]
delete Delete a shared file [aliases: del, rm]
exists Check whether a remote file exists [aliases: e]
generate Generate assets [aliases: gen]
help Prints this message or the help of the given subcommand(s)
history View file history [aliases: h]
info Fetch info about a shared file [aliases: i]
@ -502,20 +786,19 @@ SUBCOMMANDS:
password Change the password of a shared file [aliases: pass, p]
version Determine the Send server version [aliases: v]
The public Send service that is used as default host is provided by Mozilla.
This application is not affiliated with Mozilla, Firefox or Firefox Send.
This application is not affiliated with Firefox or Mozilla.
```
## Special thanks
- to [Mozilla][mozilla] for building and hosting the amazing
[Firefox Send][send] service
- to all `ffsend` source/package contributors
- to [Mozilla][mozilla] for building the amazing [Firefox Send][mozilla-send] service ([fork][timvisee-send])
- to everyone involved with [asciinema][asciinema] and [svg-term][svg-term] for
providing tools to make great visual demos
- to everyone involved in all crate dependencies used
## License
This project is released under the GNU GPL-3.0 license.
Check out the [LICENSE](LICENSE) file for more information.
Check out the [LICENSE](LICENSE) file for more information.
[usage-demo-asciinema]: https://asciinema.org/a/182225
[usage-demo-svg]: https://cdn.rawgit.com/timvisee/ffsend/6e8ef55b/res/demo.svg
@ -524,16 +807,29 @@ Check out the [LICENSE](LICENSE) file for more information.
[libressl]: https://libressl.org/
[mozilla]: https://mozilla.org/
[openssl]: https://www.openssl.org/
[openssl-windows-installer]: https://slproweb.com/download/Win64OpenSSL_Light-1_1_0j.exe
[openssl-windows-installer]: https://u.visee.me/dl/openssl/Win64OpenSSL_Light-1_1_0j.exe
[termux]: https://termux.com/
[rust]: https://rust-lang.org/
[rustup]: https://rustup.rs/
[send]: https://send.firefox.com/
[send-encryption]: https://github.com/mozilla/send/blob/master/docs/encryption.md
[send]: https://github.com/timvisee/send
[mozilla-send]: https://github.com/mozilla/send
[timvisee-send]: https://github.com/timvisee/send
[send-encryption]: https://github.com/timvisee/send/blob/master/docs/encryption.md
[asciinema]: https://asciinema.org/
[svg-term]: https://github.com/marionebl/svg-term-cli
[github-releases]: https://github.com/timvisee/ffsend/releases
[github-latest-release]: https://github.com/timvisee/ffsend/releases/latest
[nix-ffsend]: https://nixos.org/nixos/packages.html?attr=ffsend&channel=nixos-unstable&query=ffsend
[fedora-ffsend]: https://src.fedoraproject.org/rpms/rust-ffsend
[aur-ffsend]: https://aur.archlinux.org/packages/ffsend/
[aur-ffsend-bin]: https://aur.archlinux.org/packages/ffsend-bin/
[aur-ffsend-git]: https://aur.archlinux.org/packages/ffsend-git/
[alpine-ffsend]: https://pkgs.alpinelinux.org/packages?name=ffsend&branch=edge
[snapcraft-ffsend]: https://snapcraft.io/ffsend
[homebrew]: https://brew.sh/
[wsl]: https://docs.microsoft.com/en-us/windows/wsl/install-win10
[docker-hub-ffsend]: https://hub.docker.com/r/timvisee/ffsend
[scoop-install]: https://scoop.sh/#installs-in-seconds
[freshports-ffsend]: https://www.freshports.org/www/ffsend
[timvisee]: https://timvisee.com/
[donate]: https://timvisee.com/donate

18
SECURITY.md Normal file
View file

@ -0,0 +1,18 @@
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| 0.2.x | :white_check_mark: |
## Reporting a Vulnerability
To report a vulnerability in this project, or in one if it's dependency;
please [open](https://gitlab.com/timvisee/ffsend/issues/new) a new issue
on GitLab (or on [GitHub](https://github.com/timvisee/ffsend/issues/new)) describing the situation.
For confidential issues, you may send an email to the main developer (@timvisee) at: `3a4fb3964f@sinenomine.email`
Or see other methods of contacting over on: [timvisee.com/contact](https://timvisee.com/contact)
To contribute code for fixing a vulnerability, please refer to the [contribution](./CONTRIBUTING.md) document.

View file

@ -12,7 +12,6 @@ branches:
# Build for the x86_64 Windows target
platform: x64
environment:
SSL_CERT_FILE: "C:\\OpenSSL\\cacert.pem"
RUSTUP_USE_HYPER: 1
CARGO_HTTP_CHECK_REVOKE: false
GITHUB_TOKEN:
@ -23,23 +22,14 @@ environment:
matrix:
- TARGET: x86_64-pc-windows-msvc
BITS: 64
OPENSSL_VERSION: 1_1_0j
OPENSSL_DIR: C:\OpenSSL
# Extract release binary artifacts
artifacts:
- path: .\ffsend*.exe
- path: .\ffsend.*.nupkg
# Install dependencies: Rust and OpenSSL
# Install dependencies: Rust
install:
# Install OpenSSL
- mkdir C:\OpenSSL
- ps: if (Test-Path env:OPENSSL_VERSION) { Start-FileDownload "http://slproweb.com/download/Win${env:BITS}OpenSSL-${env:OPENSSL_VERSION}.exe" }
- if defined OPENSSL_VERSION Win%BITS%OpenSSL-%OPENSSL_VERSION%.exe /SILENT /VERYSILENT /SP- /DIR="C:\OpenSSL"
- appveyor DownloadFile https://curl.haxx.se/ca/cacert.pem -FileName C:\OpenSSL\cacert.pem
- choco install openssl.light --version 1.1.0.80000000 -y -f
# Install Rust
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain stable
@ -73,7 +63,8 @@ build_script:
- cd ..\..\..\
# Create the release, upload the binaries
- ps: .\github-release.exe release --token $env:GITHUB_TOKEN --owner timvisee --repo ffsend --tag $env:APPVEYOR_REPO_TAG_NAME --title "ffsend $env:APPVEYOR_REPO_TAG_NAME"
# TODO: fix the line below, which is causing CI to error
# - ps: Invoke-Expression -Command '$ErrorActionPreference = "SilentlyContinue"; .\github-release.exe release --token $env:GITHUB_TOKEN --owner timvisee --repo ffsend --tag $env:APPVEYOR_REPO_TAG_NAME --title "ffsend $env:APPVEYOR_REPO_TAG_NAME"; exit 0'
- ps: .\github-release.exe upload --token $env:GITHUB_TOKEN --owner timvisee --repo ffsend --tag $env:APPVEYOR_REPO_TAG_NAME --file .\ffsend-$env:TARGET.exe --name ffsend-$env:APPVEYOR_REPO_TAG_NAME-windows-x64.exe
- ps: .\github-release.exe upload --token $env:GITHUB_TOKEN --owner timvisee --repo ffsend --tag $env:APPVEYOR_REPO_TAG_NAME --file .\ffsend-$env:TARGET-static.exe --name ffsend-$env:APPVEYOR_REPO_TAG_NAME-windows-x64-static.exe
- ps: .\github-release.exe upload --token $env:GITHUB_TOKEN --owner timvisee --repo ffsend --tag $env:APPVEYOR_REPO_TAG_NAME --file (Get-Item .\ffsend.*.nupkg).FullName --name ffsend-$env:APPVEYOR_REPO_TAG_NAME.nupkg

37
build.rs Normal file
View file

@ -0,0 +1,37 @@
fn main() {
#[cfg(all(
feature = "clipboard",
any(
target_os = "linux",
target_os = "freebsd",
target_os = "dragonfly",
target_os = "openbsd",
target_os = "netbsd",
)
))]
{
// Select clipboard binary method
#[cfg(not(feature = "clipboard-crate"))]
println!("cargo:rustc-cfg=feature=\"clipboard-bin\"");
// xclip and xsel paths are inserted at compile time
println!("cargo:rerun-if-env-changed=XCLIP_PATH");
println!("cargo:rerun-if-env-changed=XSEL_PATH");
}
#[cfg(all(
feature = "clipboard",
not(any(
target_os = "linux",
target_os = "freebsd",
target_os = "dragonfly",
target_os = "openbsd",
target_os = "netbsd",
))
))]
{
// Select clipboard crate method
#[cfg(not(feature = "clipboard-bin"))]
println!("cargo:rustc-cfg=feature=\"clipboard-crate\"");
}
}

1919
contrib/completions/_ffsend vendored Normal file

File diff suppressed because it is too large Load diff

515
contrib/completions/_ffsend.ps1 vendored Normal file
View file

@ -0,0 +1,515 @@
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
Register-ArgumentCompleter -Native -CommandName 'ffsend' -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
$commandElements = $commandAst.CommandElements
$command = @(
'ffsend'
for ($i = 1; $i -lt $commandElements.Count; $i++) {
$element = $commandElements[$i]
if ($element -isnot [StringConstantExpressionAst] -or
$element.StringConstantType -ne [StringConstantType]::BareWord -or
$element.Value.StartsWith('-')) {
break
}
$element.Value
}) -join ';'
$completions = @(switch ($command) {
'ffsend' {
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('debug', 'debug', [CompletionResultType]::ParameterValue, 'View debug information')
[CompletionResult]::new('delete', 'delete', [CompletionResultType]::ParameterValue, 'Delete a shared file')
[CompletionResult]::new('download', 'download', [CompletionResultType]::ParameterValue, 'Download files')
[CompletionResult]::new('exists', 'exists', [CompletionResultType]::ParameterValue, 'Check whether a remote file exists')
[CompletionResult]::new('generate', 'generate', [CompletionResultType]::ParameterValue, 'Generate assets')
[CompletionResult]::new('info', 'info', [CompletionResultType]::ParameterValue, 'Fetch info about a shared file')
[CompletionResult]::new('parameters', 'parameters', [CompletionResultType]::ParameterValue, 'Change parameters of a shared file')
[CompletionResult]::new('password', 'password', [CompletionResultType]::ParameterValue, 'Change the password of a shared file')
[CompletionResult]::new('upload', 'upload', [CompletionResultType]::ParameterValue, 'Upload files')
[CompletionResult]::new('version', 'version', [CompletionResultType]::ParameterValue, 'Determine the Send server version')
[CompletionResult]::new('history', 'history', [CompletionResultType]::ParameterValue, 'View file history')
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Prints this message or the help of the given subcommand(s)')
break
}
'ffsend;debug' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'The remote host to upload to')
[CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'The remote host to upload to')
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
break
}
'ffsend;delete' {
[CompletionResult]::new('-o', 'o', [CompletionResultType]::ParameterName, 'Specify the file owner token')
[CompletionResult]::new('--owner', 'owner', [CompletionResultType]::ParameterName, 'Specify the file owner token')
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
break
}
'ffsend;download' {
[CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'Unlock a password protected file')
[CompletionResult]::new('--password', 'password', [CompletionResultType]::ParameterName, 'Unlock a password protected file')
[CompletionResult]::new('-o', 'o', [CompletionResultType]::ParameterName, 'Output file or directory')
[CompletionResult]::new('--output', 'output', [CompletionResultType]::ParameterName, 'Output file or directory')
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('-e', 'e', [CompletionResultType]::ParameterName, 'Extract an archived file')
[CompletionResult]::new('--extract', 'extract', [CompletionResultType]::ParameterName, 'Extract an archived file')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
break
}
'ffsend;exists' {
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
break
}
'ffsend;generate' {
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Shell completions')
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Prints this message or the help of the given subcommand(s)')
break
}
'ffsend;generate;completions' {
[CompletionResult]::new('-o', 'o', [CompletionResultType]::ParameterName, 'Shell completion files output directory')
[CompletionResult]::new('--output', 'output', [CompletionResultType]::ParameterName, 'Shell completion files output directory')
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
break
}
'ffsend;generate;help' {
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
break
}
'ffsend;info' {
[CompletionResult]::new('-o', 'o', [CompletionResultType]::ParameterName, 'Specify the file owner token')
[CompletionResult]::new('--owner', 'owner', [CompletionResultType]::ParameterName, 'Specify the file owner token')
[CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'Unlock a password protected file')
[CompletionResult]::new('--password', 'password', [CompletionResultType]::ParameterName, 'Unlock a password protected file')
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
break
}
'ffsend;parameters' {
[CompletionResult]::new('-o', 'o', [CompletionResultType]::ParameterName, 'Specify the file owner token')
[CompletionResult]::new('--owner', 'owner', [CompletionResultType]::ParameterName, 'Specify the file owner token')
[CompletionResult]::new('-d', 'd', [CompletionResultType]::ParameterName, 'The file download limit')
[CompletionResult]::new('--download-limit', 'download-limit', [CompletionResultType]::ParameterName, 'The file download limit')
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
break
}
'ffsend;password' {
[CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'Specify a password, do not prompt')
[CompletionResult]::new('--password', 'password', [CompletionResultType]::ParameterName, 'Specify a password, do not prompt')
[CompletionResult]::new('-o', 'o', [CompletionResultType]::ParameterName, 'Specify the file owner token')
[CompletionResult]::new('--owner', 'owner', [CompletionResultType]::ParameterName, 'Specify the file owner token')
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('-P', 'P', [CompletionResultType]::ParameterName, 'Protect the file with a generated passphrase')
[CompletionResult]::new('--gen-passphrase', 'gen-passphrase', [CompletionResultType]::ParameterName, 'Protect the file with a generated passphrase')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
break
}
'ffsend;upload' {
[CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'Protect the file with a password')
[CompletionResult]::new('--password', 'password', [CompletionResultType]::ParameterName, 'Protect the file with a password')
[CompletionResult]::new('-d', 'd', [CompletionResultType]::ParameterName, 'The file download limit')
[CompletionResult]::new('--download-limit', 'download-limit', [CompletionResultType]::ParameterName, 'The file download limit')
[CompletionResult]::new('-e', 'e', [CompletionResultType]::ParameterName, 'The file expiry time')
[CompletionResult]::new('--expiry-time', 'expiry-time', [CompletionResultType]::ParameterName, 'The file expiry time')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'The remote host to upload to')
[CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'The remote host to upload to')
[CompletionResult]::new('-n', 'n', [CompletionResultType]::ParameterName, 'Rename the file being uploaded')
[CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'Rename the file being uploaded')
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('-P', 'P', [CompletionResultType]::ParameterName, 'Protect the file with a generated passphrase')
[CompletionResult]::new('--gen-passphrase', 'gen-passphrase', [CompletionResultType]::ParameterName, 'Protect the file with a generated passphrase')
[CompletionResult]::new('-o', 'o', [CompletionResultType]::ParameterName, 'Open the share link in your browser')
[CompletionResult]::new('--open', 'open', [CompletionResultType]::ParameterName, 'Open the share link in your browser')
[CompletionResult]::new('-D', 'D', [CompletionResultType]::ParameterName, 'Delete local file after upload')
[CompletionResult]::new('--delete', 'delete', [CompletionResultType]::ParameterName, 'Delete local file after upload')
[CompletionResult]::new('-a', 'a', [CompletionResultType]::ParameterName, 'Archive the upload in a single file')
[CompletionResult]::new('--archive', 'archive', [CompletionResultType]::ParameterName, 'Archive the upload in a single file')
[CompletionResult]::new('-c', 'c', [CompletionResultType]::ParameterName, 'Copy the share link to your clipboard')
[CompletionResult]::new('--copy', 'copy', [CompletionResultType]::ParameterName, 'Copy the share link to your clipboard')
[CompletionResult]::new('-C', 'C', [CompletionResultType]::ParameterName, 'Copy the ffsend download command to your clipboard')
[CompletionResult]::new('--copy-cmd', 'copy-cmd', [CompletionResultType]::ParameterName, 'Copy the ffsend download command to your clipboard')
[CompletionResult]::new('-S', 'S', [CompletionResultType]::ParameterName, 'Shorten share URLs with a public service')
[CompletionResult]::new('--shorten', 'shorten', [CompletionResultType]::ParameterName, 'Shorten share URLs with a public service')
[CompletionResult]::new('-Q', 'Q', [CompletionResultType]::ParameterName, 'Print a QR code for the share URL')
[CompletionResult]::new('--qrcode', 'qrcode', [CompletionResultType]::ParameterName, 'Print a QR code for the share URL')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
break
}
'ffsend;version' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'The remote host to upload to')
[CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'The remote host to upload to')
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
break
}
'ffsend;history' {
[CompletionResult]::new('-R', 'R', [CompletionResultType]::ParameterName, 'Remove history entry')
[CompletionResult]::new('--rm', 'rm', [CompletionResultType]::ParameterName, 'Remove history entry')
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('-C', 'C', [CompletionResultType]::ParameterName, 'Clear all history')
[CompletionResult]::new('--clear', 'clear', [CompletionResultType]::ParameterName, 'Clear all history')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
break
}
'ffsend;help' {
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('--timeout', 'timeout', [CompletionResultType]::ParameterName, 'Request timeout (0 to disable)')
[CompletionResult]::new('-T', 'T', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('--transfer-timeout', 'transfer-timeout', [CompletionResultType]::ParameterName, 'Transfer timeout (0 to disable)')
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--api', 'api', [CompletionResultType]::ParameterName, 'Server API version to use, ''-'' to lookup')
[CompletionResult]::new('--basic-auth', 'basic-auth', [CompletionResultType]::ParameterName, 'Protected proxy HTTP basic authentication credentials (not FxA)')
[CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('--history', 'history', [CompletionResultType]::ParameterName, 'Use the specified history file')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('--force', 'force', [CompletionResultType]::ParameterName, 'Force the action, ignore warnings')
[CompletionResult]::new('-I', 'I', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('--no-interact', 'no-interact', [CompletionResultType]::ParameterName, 'Not interactive, do not prompt')
[CompletionResult]::new('-y', 'y', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Assume yes for prompts')
[CompletionResult]::new('-q', 'q', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('--quiet', 'quiet', [CompletionResultType]::ParameterName, 'Produce output suitable for logging and automation')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Enable verbose information and logging')
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
[CompletionResult]::new('--incognito', 'incognito', [CompletionResultType]::ParameterName, 'Don''t update local history for actions')
break
}
})
$completions.Where{ $_.CompletionText -like "$wordToComplete*" } |
Sort-Object -Property ListItemText
}

2512
contrib/completions/ffsend.bash vendored Normal file

File diff suppressed because it is too large Load diff

493
contrib/completions/ffsend.elv vendored Normal file
View file

@ -0,0 +1,493 @@
edit:completion:arg-completer[ffsend] = [@words]{
fn spaces [n]{
repeat $n ' ' | joins ''
}
fn cand [text desc]{
edit:complex-candidate $text &display-suffix=' '(spaces (- 14 (wcswidth $text)))$desc
}
command = 'ffsend'
for word $words[1:-1] {
if (has-prefix $word '-') {
break
}
command = $command';'$word
}
completions = [
&'ffsend'= {
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand debug 'View debug information'
cand delete 'Delete a shared file'
cand download 'Download files'
cand exists 'Check whether a remote file exists'
cand generate 'Generate assets'
cand info 'Fetch info about a shared file'
cand parameters 'Change parameters of a shared file'
cand password 'Change the password of a shared file'
cand upload 'Upload files'
cand version 'Determine the Send server version'
cand history 'View file history'
cand help 'Prints this message or the help of the given subcommand(s)'
}
&'ffsend;debug'= {
cand -h 'The remote host to upload to'
cand --host 'The remote host to upload to'
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
}
&'ffsend;delete'= {
cand -o 'Specify the file owner token'
cand --owner 'Specify the file owner token'
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
}
&'ffsend;download'= {
cand -p 'Unlock a password protected file'
cand --password 'Unlock a password protected file'
cand -o 'Output file or directory'
cand --output 'Output file or directory'
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand -e 'Extract an archived file'
cand --extract 'Extract an archived file'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
}
&'ffsend;exists'= {
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
}
&'ffsend;generate'= {
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
cand completions 'Shell completions'
cand help 'Prints this message or the help of the given subcommand(s)'
}
&'ffsend;generate;completions'= {
cand -o 'Shell completion files output directory'
cand --output 'Shell completion files output directory'
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
}
&'ffsend;generate;help'= {
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
}
&'ffsend;info'= {
cand -o 'Specify the file owner token'
cand --owner 'Specify the file owner token'
cand -p 'Unlock a password protected file'
cand --password 'Unlock a password protected file'
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
}
&'ffsend;parameters'= {
cand -o 'Specify the file owner token'
cand --owner 'Specify the file owner token'
cand -d 'The file download limit'
cand --download-limit 'The file download limit'
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
}
&'ffsend;password'= {
cand -p 'Specify a password, do not prompt'
cand --password 'Specify a password, do not prompt'
cand -o 'Specify the file owner token'
cand --owner 'Specify the file owner token'
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand -P 'Protect the file with a generated passphrase'
cand --gen-passphrase 'Protect the file with a generated passphrase'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
}
&'ffsend;upload'= {
cand -p 'Protect the file with a password'
cand --password 'Protect the file with a password'
cand -d 'The file download limit'
cand --download-limit 'The file download limit'
cand -e 'The file expiry time'
cand --expiry-time 'The file expiry time'
cand -h 'The remote host to upload to'
cand --host 'The remote host to upload to'
cand -n 'Rename the file being uploaded'
cand --name 'Rename the file being uploaded'
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand -P 'Protect the file with a generated passphrase'
cand --gen-passphrase 'Protect the file with a generated passphrase'
cand -o 'Open the share link in your browser'
cand --open 'Open the share link in your browser'
cand -D 'Delete local file after upload'
cand --delete 'Delete local file after upload'
cand -a 'Archive the upload in a single file'
cand --archive 'Archive the upload in a single file'
cand -c 'Copy the share link to your clipboard'
cand --copy 'Copy the share link to your clipboard'
cand -C 'Copy the ffsend download command to your clipboard'
cand --copy-cmd 'Copy the ffsend download command to your clipboard'
cand -S 'Shorten share URLs with a public service'
cand --shorten 'Shorten share URLs with a public service'
cand -Q 'Print a QR code for the share URL'
cand --qrcode 'Print a QR code for the share URL'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
}
&'ffsend;version'= {
cand -h 'The remote host to upload to'
cand --host 'The remote host to upload to'
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
}
&'ffsend;history'= {
cand -R 'Remove history entry'
cand --rm 'Remove history entry'
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand -C 'Clear all history'
cand --clear 'Clear all history'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
}
&'ffsend;help'= {
cand -t 'Request timeout (0 to disable)'
cand --timeout 'Request timeout (0 to disable)'
cand -T 'Transfer timeout (0 to disable)'
cand --transfer-timeout 'Transfer timeout (0 to disable)'
cand -A 'Server API version to use, ''-'' to lookup'
cand --api 'Server API version to use, ''-'' to lookup'
cand --basic-auth 'Protected proxy HTTP basic authentication credentials (not FxA)'
cand -H 'Use the specified history file'
cand --history 'Use the specified history file'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand -f 'Force the action, ignore warnings'
cand --force 'Force the action, ignore warnings'
cand -I 'Not interactive, do not prompt'
cand --no-interact 'Not interactive, do not prompt'
cand -y 'Assume yes for prompts'
cand --yes 'Assume yes for prompts'
cand -q 'Produce output suitable for logging and automation'
cand --quiet 'Produce output suitable for logging and automation'
cand -v 'Enable verbose information and logging'
cand --verbose 'Enable verbose information and logging'
cand -i 'Don''t update local history for actions'
cand --incognito 'Don''t update local history for actions'
}
]
$completions[$command]
}

238
contrib/completions/ffsend.fish vendored Normal file
View file

@ -0,0 +1,238 @@
complete -c ffsend -n "__fish_use_subcommand" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_use_subcommand" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_use_subcommand" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_use_subcommand" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_use_subcommand" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_use_subcommand" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_use_subcommand" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_use_subcommand" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_use_subcommand" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_use_subcommand" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_use_subcommand" -s i -l incognito -d 'Don\'t update local history for actions'
complete -c ffsend -n "__fish_use_subcommand" -s h -l help -d 'Prints help information'
complete -c ffsend -n "__fish_use_subcommand" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_use_subcommand" -f -a "debug" -d 'View debug information'
complete -c ffsend -n "__fish_use_subcommand" -f -a "delete" -d 'Delete a shared file'
complete -c ffsend -n "__fish_use_subcommand" -f -a "download" -d 'Download files'
complete -c ffsend -n "__fish_use_subcommand" -f -a "exists" -d 'Check whether a remote file exists'
complete -c ffsend -n "__fish_use_subcommand" -f -a "generate" -d 'Generate assets'
complete -c ffsend -n "__fish_use_subcommand" -f -a "info" -d 'Fetch info about a shared file'
complete -c ffsend -n "__fish_use_subcommand" -f -a "parameters" -d 'Change parameters of a shared file'
complete -c ffsend -n "__fish_use_subcommand" -f -a "password" -d 'Change the password of a shared file'
complete -c ffsend -n "__fish_use_subcommand" -f -a "upload" -d 'Upload files'
complete -c ffsend -n "__fish_use_subcommand" -f -a "version" -d 'Determine the Send server version'
complete -c ffsend -n "__fish_use_subcommand" -f -a "history" -d 'View file history'
complete -c ffsend -n "__fish_use_subcommand" -f -a "help" -d 'Prints this message or the help of the given subcommand(s)'
complete -c ffsend -n "__fish_seen_subcommand_from debug" -s h -l host -d 'The remote host to upload to'
complete -c ffsend -n "__fish_seen_subcommand_from debug" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from debug" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from debug" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_seen_subcommand_from debug" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_seen_subcommand_from debug" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_seen_subcommand_from debug" -l help -d 'Prints help information'
complete -c ffsend -n "__fish_seen_subcommand_from debug" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_seen_subcommand_from debug" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_seen_subcommand_from debug" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from debug" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_seen_subcommand_from debug" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_seen_subcommand_from debug" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_seen_subcommand_from debug" -s i -l incognito -d 'Don\'t update local history for actions'
complete -c ffsend -n "__fish_seen_subcommand_from delete" -s o -l owner -d 'Specify the file owner token'
complete -c ffsend -n "__fish_seen_subcommand_from delete" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from delete" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from delete" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_seen_subcommand_from delete" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_seen_subcommand_from delete" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_seen_subcommand_from delete" -s h -l help -d 'Prints help information'
complete -c ffsend -n "__fish_seen_subcommand_from delete" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_seen_subcommand_from delete" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_seen_subcommand_from delete" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from delete" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_seen_subcommand_from delete" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_seen_subcommand_from delete" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_seen_subcommand_from delete" -s i -l incognito -d 'Don\'t update local history for actions'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s p -l password -d 'Unlock a password protected file'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s o -l output -d 'Output file or directory'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_seen_subcommand_from download" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s e -l extract -d 'Extract an archived file'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s h -l help -d 'Prints help information'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_seen_subcommand_from download" -s i -l incognito -d 'Don\'t update local history for actions'
complete -c ffsend -n "__fish_seen_subcommand_from exists" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from exists" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from exists" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_seen_subcommand_from exists" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_seen_subcommand_from exists" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_seen_subcommand_from exists" -s h -l help -d 'Prints help information'
complete -c ffsend -n "__fish_seen_subcommand_from exists" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_seen_subcommand_from exists" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_seen_subcommand_from exists" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from exists" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_seen_subcommand_from exists" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_seen_subcommand_from exists" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_seen_subcommand_from exists" -s i -l incognito -d 'Don\'t update local history for actions'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -s h -l help -d 'Prints help information'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -s i -l incognito -d 'Don\'t update local history for actions'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -f -a "completions" -d 'Shell completions'
complete -c ffsend -n "__fish_seen_subcommand_from generate" -f -a "help" -d 'Prints this message or the help of the given subcommand(s)'
complete -c ffsend -n "__fish_seen_subcommand_from completions" -s o -l output -d 'Shell completion files output directory'
complete -c ffsend -n "__fish_seen_subcommand_from completions" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from completions" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from completions" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_seen_subcommand_from completions" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_seen_subcommand_from completions" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_seen_subcommand_from completions" -s h -l help -d 'Prints help information'
complete -c ffsend -n "__fish_seen_subcommand_from completions" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_seen_subcommand_from completions" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_seen_subcommand_from completions" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from completions" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_seen_subcommand_from completions" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_seen_subcommand_from completions" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_seen_subcommand_from completions" -s i -l incognito -d 'Don\'t update local history for actions'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_seen_subcommand_from help" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s h -l help -d 'Prints help information'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s i -l incognito -d 'Don\'t update local history for actions'
complete -c ffsend -n "__fish_seen_subcommand_from info" -s o -l owner -d 'Specify the file owner token'
complete -c ffsend -n "__fish_seen_subcommand_from info" -s p -l password -d 'Unlock a password protected file'
complete -c ffsend -n "__fish_seen_subcommand_from info" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from info" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from info" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_seen_subcommand_from info" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_seen_subcommand_from info" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_seen_subcommand_from info" -s h -l help -d 'Prints help information'
complete -c ffsend -n "__fish_seen_subcommand_from info" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_seen_subcommand_from info" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_seen_subcommand_from info" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from info" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_seen_subcommand_from info" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_seen_subcommand_from info" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_seen_subcommand_from info" -s i -l incognito -d 'Don\'t update local history for actions'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -s o -l owner -d 'Specify the file owner token'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -s d -l download-limit -d 'The file download limit'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -s h -l help -d 'Prints help information'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_seen_subcommand_from parameters" -s i -l incognito -d 'Don\'t update local history for actions'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s p -l password -d 'Specify a password, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s o -l owner -d 'Specify the file owner token'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_seen_subcommand_from password" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s P -l gen-passphrase -d 'Protect the file with a generated passphrase'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s h -l help -d 'Prints help information'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_seen_subcommand_from password" -s i -l incognito -d 'Don\'t update local history for actions'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s p -l password -d 'Protect the file with a password'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s d -l download-limit -d 'The file download limit'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s e -l expiry-time -d 'The file expiry time'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s h -l host -d 'The remote host to upload to'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s n -l name -d 'Rename the file being uploaded'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s P -l gen-passphrase -d 'Protect the file with a generated passphrase'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s o -l open -d 'Open the share link in your browser'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s D -l delete -d 'Delete local file after upload'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s a -l archive -d 'Archive the upload in a single file'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s c -l copy -d 'Copy the share link to your clipboard'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s C -l copy-cmd -d 'Copy the ffsend download command to your clipboard'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s S -l shorten -d 'Shorten share URLs with a public service'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s Q -l qrcode -d 'Print a QR code for the share URL'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -l help -d 'Prints help information'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_seen_subcommand_from upload" -s i -l incognito -d 'Don\'t update local history for actions'
complete -c ffsend -n "__fish_seen_subcommand_from version" -s h -l host -d 'The remote host to upload to'
complete -c ffsend -n "__fish_seen_subcommand_from version" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from version" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from version" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_seen_subcommand_from version" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_seen_subcommand_from version" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_seen_subcommand_from version" -l help -d 'Prints help information'
complete -c ffsend -n "__fish_seen_subcommand_from version" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_seen_subcommand_from version" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_seen_subcommand_from version" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from version" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_seen_subcommand_from version" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_seen_subcommand_from version" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_seen_subcommand_from version" -s i -l incognito -d 'Don\'t update local history for actions'
complete -c ffsend -n "__fish_seen_subcommand_from history" -s R -l rm -d 'Remove history entry'
complete -c ffsend -n "__fish_seen_subcommand_from history" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from history" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from history" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_seen_subcommand_from history" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_seen_subcommand_from history" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_seen_subcommand_from history" -s C -l clear -d 'Clear all history'
complete -c ffsend -n "__fish_seen_subcommand_from history" -s h -l help -d 'Prints help information'
complete -c ffsend -n "__fish_seen_subcommand_from history" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_seen_subcommand_from history" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_seen_subcommand_from history" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from history" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_seen_subcommand_from history" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_seen_subcommand_from history" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_seen_subcommand_from history" -s i -l incognito -d 'Don\'t update local history for actions'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s t -l timeout -d 'Request timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s T -l transfer-timeout -d 'Transfer timeout (0 to disable)'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s A -l api -d 'Server API version to use, \'-\' to lookup'
complete -c ffsend -n "__fish_seen_subcommand_from help" -l basic-auth -d 'Protected proxy HTTP basic authentication credentials (not FxA)'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s H -l history -d 'Use the specified history file'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s h -l help -d 'Prints help information'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s V -l version -d 'Prints version information'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s f -l force -d 'Force the action, ignore warnings'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s I -l no-interact -d 'Not interactive, do not prompt'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s y -l yes -d 'Assume yes for prompts'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s q -l quiet -d 'Produce output suitable for logging and automation'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s v -l verbose -d 'Enable verbose information and logging'
complete -c ffsend -n "__fish_seen_subcommand_from help" -s i -l incognito -d 'Don\'t update local history for actions'

View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
# Stop on error
set -e
echo "Generating all completions using cargo debug binary..."
cargo run -q -- generate completions all --output "$PWD"
echo "Done."

View file

@ -0,0 +1,6 @@
`firefox-send` is a script for Nautilus/Nemo/Caja (maybe it needs some adaptation for Caja) to send files directly from the file browser, using the contextual menu.
* Copy the `firefox-send` file to ~/.local/share/nautilus/scripts/firefox-send
* Modify the default options to your use case: host server, download number, retention time.
* Make the file executable (`chmod +x firefox-send`).
* Restart Nautilus/Nemo/Caja.

View file

@ -0,0 +1,46 @@
#!/bin/bash
#CONSTANTS
#FILEPATH=`echo $NAUTILUS_SCRIPT_SELECTED_URIS | sed 's@file://@@g'`
# Quote the paths
IFS=$'\n' read -d '' -r -a FILEPATH <<< "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
FFSEND_BIN='/usr/bin/ffsend'
FFSEND_BIN_OPTS="upload --open --copy"
ZENITY='/usr/bin/zenity '
ZENITY_PROGRESS_OPTIONS='--auto-close --auto-kill' #you can remove this if you like
#sanity checks
for sanity_check in $FFSEND_BIN "${FILEPATH[@]}"
do
ZENITY_ERROR_SANITY="There is an error, it involved $sanity_check.\n Probably binary or file missing"
if [ ! -e $sanity_check ]
then
#zenity --error --text="$(eval "echo \"$ZENITY_ERROR_SANITY\"")"
zenity --error --text="$ZENITY_ERROR_SANITY"
exit
fi
done
# Use the following flags automatically from now on
# -I: no interaction
# -f: force
# -y: yes
# -q: quiet
export FFSEND_NO_INTERACT=1 FFSEND_FORCE=1 FFSEND_YES=1 FFSEND_QUIET=1
export FFSEND_HOST=https://send.boblorange.net
export FFSEND_EXPIRY_TIME=604800
export FFSEND_DOWNLOAD_LIMIT=5
#check whether copying file or directory
if [ ! -f "${FILEPATH[@]}" ]; then
FFSEND_BIN_OPTS="$FFSEND_BIN_OPTS --archive"
fi
# Upload a file
#zenity --info --text="Ready to send: $FFSEND_BIN $FFSEND_BIN_OPTS ${FILEPATH[@]}"
$FFSEND_BIN $FFSEND_BIN_OPTS "${FILEPATH[@]}" | $($ZENITY --progress --text="sending $(basename $FILEPATH)" --pulsate $ZENITY_PROGRESS_OPTIONS)
#echo -e "$FILEPATH" | xargs -i $FFSEND_BIN $FFSEND_BIN_OPTS {} | $($ZENITY --progress --text="sending $(basename $FILEPATH)" --pulsate $ZENITY_PROGRESS_OPTIONS)
# Upload a file
#echo -e "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | xargs -i ffsend upload --open --copy {}

65
pkg/alpine/APKBUILD Normal file
View file

@ -0,0 +1,65 @@
# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=ffsend
pkgver=0.2.62
pkgrel=0
pkgdesc=" A fully featured Send client"
url="https://gitlab.com/timvisee/ffsend"
arch="x86_64 x86 armhf armv7 aarch64 ppc64le" # limited by cargo
license="GPL-3.0-only"
makedepends="cargo openssl-dev"
subpackages="
$pkgname-zsh-completion:zshcomp:noarch
$pkgname-fish-completion:fishcomp:noarch
$pkgname-bash-completion:bashcomp:noarch
"
source="https://gitlab.com/timvisee/ffsend/-/archive/v$pkgver/ffsend-v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"
case "$CARCH" in
x86)
export CFLAGS="$CFLAGS -fno-stack-protector"
;;
esac
build() {
cargo build --release
}
check() {
cargo test --release
}
package() {
cargo install --path . --root="$pkgdir/usr"
rm "$pkgdir"/usr/.crates.toml
}
bashcomp() {
depends=""
pkgdesc="Bash completions for $pkgname"
install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
install -Dm644 "$builddir"/contrib/completions/ffsend.bash \
"$subpkgdir"/usr/share/bash-completion/completions/ffsend
}
zshcomp() {
depends=""
pkgdesc="Zsh compltions for $pkgname"
install_if="$pkgname=$pkgver-r$pkgrel zsh"
install -Dm644 "$builddir"/contrib/completions/_ffsend \
"$subpkgdir"/usr/share/zsh/site-functions/_ffsend
}
fishcomp() {
depends=""
pkgdesc="Fish completions for $pkgname"
install_if="$pkgname=$pkgver-r$pkgrel fish"
install -Dm644 "$builddir"/contrib/completions/ffsend.fish \
"$subpkgdir"/usr/share/fish/completions/ffsend.fish
}
sha512sums="97477f59a498f4805340647c50c139d70ddbabaebb49b4acbae595ed9987fa2941b8d4dfd2edf76264b2a500fa10ac10f8583938fb29013936d9c092fe7fe7f1 ffsend-v0.2.51.tar.gz"

View file

@ -1,18 +0,0 @@
# Maintainer: Tim Visee <tim@visee.me>
pkgname=ffsend
pkgver=0.0.0
pkgrel=1
pkgdesc="Easily and securely share files from the command line. A Firefox Send client."
url="https://gitlab.com/timvisee/ffsend"
license=('GPL3')
conflicts=('ffsend-git')
source=("ffsend::https://github.com/timvisee/ffsend/releases/download/v$pkgver/ffsend-v$pkgver-linux-x64-static")
sha256sums=('SKIP')
arch=('x86_64')
depends=('ca-certificates')
optdepends=('xclip: clipboard support')
package() {
install -D "$srcdir/ffsend" "$pkgdir/usr/bin/ffsend"
}

View file

@ -0,0 +1,37 @@
# Maintainer: Tim Visee <tim@visee.me>
# Contributor: Ariel AxionL <i at axionl dot me>
#
# This PKGBUILD is managed externally, and is automatically updated here:
# - https://gitlab.com/timvisee/ffsend/blob/master/pkg/aur/ffsend-bin/PKGBUILD
# - Mirror: https://github.com/timvisee/ffsend/blob/master/pkg/aur/ffsend-bin/PKGBUILD
pkgname=ffsend-bin
pkgver=0.0.0 # automatically set in CI, see: /.gitlab-ci.yml
pkgrel=1
pkgdesc="Easily and securely share files from the command line. A Send client."
url="https://gitlab.com/timvisee/ffsend"
license=('GPL3')
source=("ffsend-v$pkgver::https://github.com/timvisee/ffsend/releases/download/v$pkgver/ffsend-v$pkgver-linux-x64-static"
"ffsend-v$pkgver.bash::https://raw.githubusercontent.com/timvisee/ffsend/v$pkgver/contrib/completions/ffsend.bash"
"ffsend-v$pkgver.zsh::https://raw.githubusercontent.com/timvisee/ffsend/v$pkgver/contrib/completions/_ffsend"
"ffsend-v$pkgver.fish::https://raw.githubusercontent.com/timvisee/ffsend/v$pkgver/contrib/completions/ffsend.fish"
"LICENSE-v$pkgver::https://raw.githubusercontent.com/timvisee/ffsend/v$pkgver/LICENSE") # automatically set in CI, see: /.gitlab-ci.yml
sha256sums=('SKIP')
arch=('x86_64')
provides=('ffsend')
conflicts=('ffsend')
depends=('ca-certificates')
optdepends=('xclip: clipboard support'
'bash-completion: support auto completion for bash')
package() {
cd "$srcdir"
install -Dm755 "ffsend-v$pkgver" "$pkgdir/usr/bin/ffsend"
# Shell completions and LICENSE file
install -Dm644 "ffsend-v$pkgver.bash" "$pkgdir/usr/share/bash-completion/completions/ffsend"
install -Dm644 "ffsend-v$pkgver.zsh" "$pkgdir/usr/share/zsh/site-functions/_ffsend"
install -Dm644 "ffsend-v$pkgver.fish" "$pkgdir/usr/share/fish/vendor_completions.d/ffsend.fish"
install -Dm644 "LICENSE-v$pkgver" "$pkgdir/usr/share/licenses/ffsend/LICENSE"
}

View file

@ -0,0 +1,57 @@
# Maintainer: Tim Visee <tim@visee.me>
#
# This PKGBUILD is managed externally, and is automatically updated here:
# - https://gitlab.com/timvisee/ffsend/blob/master/pkg/aur/ffsend-git/PKGBUILD
# - Mirror: https://github.com/timvisee/ffsend/blob/master/pkg/aur/ffsend-git/PKGBUILD
pkgname=ffsend-git
pkgver=0.0.0 # automatically set in CI, see: /.gitlab-ci.yml
pkgrel=1
pkgdesc="Easily and securely share files from the command line. A Send client."
url="https://gitlab.com/timvisee/ffsend"
license=('GPL3')
source=("git+${url}")
sha256sums=('SKIP')
arch=('x86_64' 'i686')
provides=('ffsend')
conflicts=('ffsend')
depends=('ca-certificates')
makedepends=('cargo' 'cmake' 'openssl>=1.0')
optdepends=('xclip: clipboard support')
prepare() {
cd "${pkgname%-git}"
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
cd "${pkgname%-git}"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --frozen --release
}
check() {
cd "${pkgname%-git}"
export RUSTUP_TOOLCHAIN=stable
cargo test --frozen
}
package() {
cd "${pkgname%-git}"
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/ffsend"
# Shell completions and LICENSE file
install -Dm644 "contrib/completions/ffsend.bash" \
"$pkgdir/etc/bash_completion.d/ffsend"
install -Dm644 "contrib/completions/_ffsend" \
"$pkgdir/usr/share/zsh/site-functions/_ffsend"
install -Dm644 "contrib/completions/ffsend.fish" \
"$pkgdir/usr/share/fish/vendor_completions.d/ffsend.fish"
install -Dm644 "LICENSE" \
"$pkgdir/usr/share/licenses/ffsend/LICENSE"
}

55
pkg/aur/ffsend/PKGBUILD Normal file
View file

@ -0,0 +1,55 @@
# Maintainer: Tim Visee <tim@visee.me>
#
# This PKGBUILD is managed externally, and is automatically updated here:
# - https://gitlab.com/timvisee/ffsend/blob/master/pkg/aur/ffsend/PKGBUILD
# - Mirror: https://github.com/timvisee/ffsend/blob/master/pkg/aur/ffsend/PKGBUILD
pkgname=ffsend
pkgver=0.0.0 # automatically set in CI, see: /.gitlab-ci.yml
pkgrel=1
pkgdesc="Easily and securely share files from the command line. A Send client."
url="https://gitlab.com/timvisee/ffsend"
license=('GPL3')
source=("$url/-/archive/v$pkgver/ffsend-v$pkgver.tar.gz") # automatically set in CI, see: /.gitlab-ci.yml
sha256sums=('SKIP') # automatically set in CI, see: /.gitlab-ci.yml
arch=('x86_64' 'i686')
depends=('ca-certificates')
makedepends=('cargo' 'cmake' 'openssl>=1.0')
optdepends=('xclip: clipboard support')
prepare() {
cd "$pkgname-v$pkgver"
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
cd "$pkgname-v$pkgver"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --frozen --release
}
check() {
cd "$pkgname-v$pkgver"
export RUSTUP_TOOLCHAIN=stable
cargo test --frozen
}
package() {
cd "$pkgname-v$pkgver"
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
# Shell completions and LICENSE file
install -Dm644 "contrib/completions/ffsend.bash" \
"$pkgdir/etc/bash_completion.d/ffsend"
install -Dm644 "contrib/completions/_ffsend" \
"$pkgdir/usr/share/zsh/site-functions/_ffsend"
install -Dm644 "contrib/completions/ffsend.fish" \
"$pkgdir/usr/share/fish/vendor_completions.d/ffsend.fish"
install -Dm644 "LICENSE" \
"$pkgdir/usr/share/licenses/ffsend/LICENSE"
}

View file

@ -1,25 +0,0 @@
# Maintainer: Tim Visee <tim@visee.me>
pkgname=ffsend-git
pkgver=0.0.0
pkgrel=1
pkgdesc="Easily and securely share files from the command line. A Firefox Send client."
url="https://gitlab.com/timvisee/ffsend"
license=('GPL3')
provides=('ffsend')
conflicts=('ffsend')
source=("ffsend-v$pkgver.tar.gz::$url/-/archive/v$pkgver/ffsend-v$pkgver.tar.gz")
sha256sums=('SKIP')
arch=('x86_64' 'i686')
depends=('ca-certificates')
makedepends=('openssl>=1.0' 'rust>=1.32' 'cargo' 'cmake')
optdepends=('xclip: clipboard support')
build() {
cd "ffsend-v$pkgver"
env CARGO_INCREMENTAL=0 cargo build --release
}
package() {
install -Dm755 "$srcdir/ffsend-v$pkgver/target/release/ffsend" "$pkgdir/usr/bin/ffsend"
}

View file

@ -45,14 +45,12 @@ This is a nuspec. It mostly adheres to https://docs.nuget.org/create/Nuspec-Refe
<docsUrl>https://github.com/timvisee/ffsend</docsUrl>
<bugTrackerUrl>https://gitlab.com/timvisee/ffsend/issues</bugTrackerUrl>
<tags>ffsend firefox-send cli file-sharing file-upload encryption rust</tags>
<summary>Easily and securely share files from the command line. A fully featured Firefox Send client.</summary>
<description>Easily and securely share files from the command line. A fully featured Firefox Send client.</description>
<summary>Easily and securely share files from the command line. A fully featured Send client.</summary>
<description>Easily and securely share files from the command line. A fully featured Send client.</description>
<!-- =============================== -->
<!-- Specifying dependencies and version ranges? https://docs.nuget.org/create/versioning#specifying-version-ranges-in-.nuspec-files -->
<dependencies>
<dependency id="openssl.light" version="" />
</dependencies>
<dependencies></dependencies>
</metadata>
<files>
<!-- this section controls what actually gets packaged into the Chocolatey package -->

View file

@ -9,13 +9,13 @@ if [[ ! $TRAVIS_TAG =~ ^v([0-9]+\.)*[0-9]+$ ]]; then
fi
# Ensure the debian architecture is set
if [[ -z "$DEB_ARCH" ]]; then
if [[ -z $DEB_ARCH ]]; then
echo "Error: debian architecture not configured in \$DEB_ARCH"
exit 1
fi
# Define some useful variables
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
VERSION=${TRAVIS_TAG:1}
# Ensure the binary file exists
@ -25,23 +25,23 @@ if [[ ! -f "$DIR/../ffsend" ]]; then
fi
# Create an application directory, copy the binary into it
mkdir -p $DIR/ffsend-$VERSION
cp $DIR/../ffsend $DIR/ffsend-$VERSION/ffsend
mkdir -p "$DIR/ffsend-$VERSION"
cp -- "$DIR/../ffsend" "$DIR/ffsend-$VERSION/ffsend"
# Create an application tarbal
cd $DIR/..
git archive --format tar.gz -o $DIR/ffsend-$VERSION/ffsend-$VERSION.tar.gz $TRAVIS_TAG
# Create an application tarball
cd -- "$DIR/.."
git archive --format tar.gz -o "$DIR/ffsend-$VERSION/ffsend-$VERSION.tar.gz" "$TRAVIS_TAG"
# Change into the app directory
cd $DIR/ffsend-$VERSION
cd -- "$DIR/ffsend-$VERSION"
# Build the debian package
# TODO: define GPG?
dh_make -e "timvisee@gmail.com" -c gpl3 -f ffsend-$VERSION.tar.gz -s -y
rm *.ex README.Debian README.source
dh_make -e "timvisee@gmail.com" -c gpl3 -f "ffsend-$VERSION.tar.gz" -s -y
rm -- *.ex README.Debian README.source
# Remove the project tar ball, we're not using it anymore
rm $DIR/ffsend-$VERSION/ffsend-$VERSION.tar.gz
rm -- "$DIR/ffsend-$VERSION/ffsend-$VERSION.tar.gz"
# TODO: configure the debian/control file
# TODO: configure copyright file

View file

@ -2,7 +2,7 @@
# Unlink the ffs alias if it links to ffsend
if [[ -L /usr/bin/ffs ]] \
&& [[ $(ls -l /usr/bin/ffs | sed -e 's/.* -> //') == "/usr/bin/ffsend" ]]; \
&& [[ $(realpath /usr/bin/ffs) == "/usr/bin/ffsend" ]]; \
then
echo "Removing ffs alias for ffsend..."
unlink /usr/bin/ffs

7
pkg/docker/Dockerfile Normal file
View file

@ -0,0 +1,7 @@
FROM alpine:latest
LABEL maintainer="Tim Visée <3a4fb3964f@sinenomine.email>"
COPY ./ffsend /
WORKDIR /data/
ENTRYPOINT ["/ffsend"]

8
pkg/scoop/README.md Normal file
View file

@ -0,0 +1,8 @@
# scoop manifest for ffsend
This directory contains a [`scoop`][scoop] manifest template for `ffsend`.
The currently published manifest can be found in the `scoop` repository,
and is automatically updated:
https://github.com/ScoopInstaller/Main/blob/master/bucket/ffsend.json
[scoop]: https://scoop.rs/

21
pkg/scoop/ffsend.json Normal file
View file

@ -0,0 +1,21 @@
{
"homepage": "https://github.com/timvisee/ffsend",
"description": "Easily and securely share files from the command line. A fully featured Send client.",
"license": "GPL-3.0-only",
"version": "0.0.0",
"architecture": {
"64bit": {
"url": "https://github.com/timvisee/ffsend/releases/download/v0.2.30/ffsend-v0.2.30-windows-x64-static.exe#/ffsend.exe",
"hash": "297f1405bacdc34948cd94ba785336c48e1ac862984268d66a8928abd3e322e1"
}
},
"bin": "ffsend.exe",
"checkver": "github",
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://github.com/timvisee/ffsend/releases/download/v$version/ffsend-v$version-windows-x64-static.exe#/ffsend.exe"
}
}
}
}

View file

@ -13,6 +13,7 @@ description: |
An optional password may be specified, and a default file lifetime of 1
(up to 20) download or 24 hours is enforced to ensure your stuff does not
remain online forever. This provides a secure platform to share your files.
# license: GPL-3.0
architectures:
- amd64
@ -23,7 +24,7 @@ confinement: strict
apps:
ffsend:
command: ffsend
plugs: [home, network, removable-media, x11]
plugs: [desktop, home, network, removable-media, x11]
parts:
ffsend:

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Ensure svg-term is installed
if ! [ -x "$(command -v svg-term)" ]; then

1
snapcraft.login Normal file
View file

@ -0,0 +1 @@
eyJyIjogIk1EQXlPV3h2WTJGMGFXOXVJRzE1WVhCd2N5NWtaWFpsYkc5d1pYSXVkV0oxYm5SMUxtTnZiUW93TURFMmFXUmxiblJwWm1sbGNpQk5lVUZ3Y0hNS01EQTBZbU5wWkNCdGVXRndjSE11WkdWMlpXeHZjR1Z5TG5WaWRXNTBkUzVqYjIxOGRtRnNhV1JmYzJsdVkyVjhNakF5TWkwd05pMHlNRlF3T0Rvd016b3hNaTQwTlRreU9EUUtNREUzWkdOcFpDQjdJblpsY25OcGIyNGlPaUF4TENBaWMyVmpjbVYwSWpvZ0ltOWFVRzlpVG1vdlJYTmhkazlYUVZoRmNIQlRNM1JNY0RGak1tdFZaVU5NYzFaWlNUQmFaa1JFZERkcVozaHhTVlI2VEhselFtOVZjV3N5VURad1JXdFFRblpNUkhOMFkwTTNSRlU1VUVFMGFXVlpPV0U0WWxGU2VtNHJNbTQxVEVsRWMwY3ZTVEphVEM4eU1uSTBjakZDYmlzM1VqRnhUVWt2WjNoR1kzVnVVV05pUlZkeVVWQXdZV3BrUTBrd1pWRmxOVEZsVmpWSVJrbzNjMlZGU0c5WVpFRlZTVVZ1Vm1GNU5sRnFVMDQzTW1SSFpWSlVabVZvYVVacmFWbFFaVVJJZVN0d1VqbHVjMXBNZW5aMFNYbHNPRnBYYVhkSVdIcFpRVTl2T0Rob1VXdFhZakZ6UzNGSGFYWjZWRFZEWlZoV1IyaElaalJSUVdRNVIwOWxLMjUxUmpWM2JHMWtaRlIwY1U1YWNWQnNjVkZHYjBoelprUk9jRFpvVFd4dWFHbDVMMGxvY2tOclZscENUVzFMYld0cFIwVk1VWFZMTUVSUVFtdFFNSE5RVWpaVVdsWnFjVGQzZVRaaFdIa3dVM1ZyZDBaclp6MDlJbjBLTURBMU1YWnBaQ0ExYU5mbjFKU3NBa1VoMFM1NXB4bnp2VUxESlRtcldMLTZSa3B0c3kzbFdVSG02T0hVQnJHeGtfYmlnbnEtbkxIMm9hYVdwaENKRkM1YzNod1BqWjBXUl83bUZ5QWN2QlFLTURBeE9HTnNJR3h2WjJsdUxuVmlkVzUwZFM1amIyMEtNREJoT1dOcFpDQnRlV0Z3Y0hNdVpHVjJaV3h2Y0dWeUxuVmlkVzUwZFM1amIyMThZV05zZkZzaWNHRmphMkZuWlY5aFkyTmxjM01pTENBaWNHRmphMkZuWlY5dFlXNWhaMlVpTENBaWNHRmphMkZuWlY5dFpYUnlhV056SWl3Z0luQmhZMnRoWjJWZmNIVnphQ0lzSUNKd1lXTnJZV2RsWDNKbFoybHpkR1Z5SWl3Z0luQmhZMnRoWjJWZmNtVnNaV0Z6WlNJc0lDSndZV05yWVdkbFgzVndaR0YwWlNKZENqQXdORGRqYVdRZ2JYbGhjSEJ6TG1SbGRtVnNiM0JsY2k1MVluVnVkSFV1WTI5dGZHVjRjR2x5WlhOOE1qQXlNeTB3TmkweU1GUXdPRG93TXpveE1pNHdNREF3TVRjS01EQXlabk5wWjI1aGRIVnlaU0JOYm05MFAyTkpYV3RON0I1aktWbkVBQUZqM0c3dzItLWNhOGloR2lJWUhRbyIsICJkIjogIk1EQXhaV3h2WTJGMGFXOXVJR3h2WjJsdUxuVmlkVzUwZFM1amIyMEtNREU0Tkdsa1pXNTBhV1pwWlhJZ2V5SjJaWEp6YVc5dUlqb2dNU3dnSW5ObFkzSmxkQ0k2SUNKdldsQnZZazVxTDBWellYWlBWMEZZUlhCd1V6TjBUSEF4WXpKclZXVkRUSE5XV1Vrd1dtWkVSSFEzYW1kNGNVbFVla3g1YzBKdlZYRnJNbEEyY0VWclVFSjJURVJ6ZEdORE4wUlZPVkJCTkdsbFdUbGhPR0pSVW5wdUt6SnVOVXhKUkhOSEwwa3lXa3d2TWpKeU5ISXhRbTRyTjFJeGNVMUpMMmQ0Um1OMWJsRmpZa1ZYY2xGUU1HRnFaRU5KTUdWUlpUVXhaVlkxU0VaS04zTmxSVWh2V0dSQlZVbEZibFpoZVRaUmFsTk9OekprUjJWU1ZHWmxhR2xHYTJsWlVHVkVTSGtyY0ZJNWJuTmFUSHAyZEVsNWJEaGFWMmwzU0ZoNldVRlBiemc0YUZGclYySXhjMHR4UjJsMmVsUTFRMlZZVmtkb1NHWTBVVUZrT1VkUFpTdHVkVVkxZDJ4dFpHUlVkSEZPV25GUWJIRlJSbTlJYzJaRVRuQTJhRTFzYm1ocGVTOUphSEpEYTFaYVFrMXRTMjFyYVVkRlRGRjFTekJFVUVKclVEQnpVRkkyVkZwV2FuRTNkM2syWVZoNU1GTjFhM2RHYTJjOVBTSjlDakF3WkRaamFXUWdiRzluYVc0dWRXSjFiblIxTG1OdmJYeGhZMk52ZFc1MGZHVjVTakZqTWxaNVltMUdkRnBUU1RaSlEwb3dZVmN4TW1GWVRteGFVMGx6U1VOS2RtTkhWblZoVjFGcFQybEJhVlZ1WkV4UlZXaDBVME5KYzBsRFNtdGhXRTUzWWtkR05XSnRSblJhVTBrMlNVTktWV0ZYTUdkV2JXeDZXRWhWZDAxSFZUVmFVMGx6U1VOS2JHSlhSbkJpUTBrMlNVTktNR0ZYTUhKa1Ywb3hZbTVTTVdJeU5XeFJTRnB3WXpKV2JFeHRNV3hKYVhkblNXMXNlbGd6V214amJXeHRZVmRXYTBscWIyZGtTRW94V2xnd1BRb3dNRFF3WTJsa0lHeHZaMmx1TG5WaWRXNTBkUzVqYjIxOGRtRnNhV1JmYzJsdVkyVjhNakF5TWkwd05pMHlNRlF3T0Rvd016b3hNeTR5T0RJd09UTUtNREF6WldOcFpDQnNiMmRwYmk1MVluVnVkSFV1WTI5dGZHeGhjM1JmWVhWMGFId3lNREl5TFRBMkxUSXdWREE0T2pBek9qRXpMakk0TWpBNU13b3dNREptYzJsbmJtRjBkWEpsSVBtdzV2aGZjWXhjRVFzX1RHV2VHWUFrQWhxdkJONVJjOFpHTEpnVFZ2eGxDZyJ9

View file

@ -6,6 +6,8 @@ use prettytable::{format::FormatBuilder, Cell, Row, Table};
use crate::client::to_duration;
use crate::cmd::matcher::{debug::DebugMatcher, main::MainMatcher, Matcher};
use crate::error::ActionError;
#[cfg(feature = "clipboard-bin")]
use crate::util::ClipboardType;
use crate::util::{api_version_list, features_list, format_bool, format_duration};
/// A file debug action.
@ -30,6 +32,12 @@ impl<'a> Debug<'a> {
let mut table = Table::new();
table.set_format(FormatBuilder::new().padding(0, 2).build());
// The crate version
table.add_row(Row::new(vec![
Cell::new("Version:"),
Cell::new(crate_version!()),
]));
// The default host
table.add_row(Row::new(vec![
Cell::new("Host:"),
@ -90,6 +98,22 @@ impl<'a> Debug<'a> {
Cell::new(&api_version_list().join(", ")),
]));
// Show used crypto backend
table.add_row(Row::new(vec![
Cell::new("Crypto backend:"),
#[cfg(feature = "crypto-ring")]
Cell::new("ring"),
#[cfg(feature = "crypto-openssl")]
Cell::new("OpenSSL"),
]));
// Clipboard information
#[cfg(feature = "clipboard-bin")]
table.add_row(Row::new(vec![
Cell::new("Clipboard:"),
Cell::new(&format!("{}", ClipboardType::select())),
]));
// Show whether quiet is used
table.add_row(Row::new(vec![
Cell::new("Quiet:"),

View file

@ -2,7 +2,7 @@ use clap::ArgMatches;
use ffsend_api::action::delete::{Delete as ApiDelete, Error as DeleteError};
use ffsend_api::file::remote_file::{FileParseError, RemoteFile};
use crate::client::create_client;
use crate::client::create_config;
use crate::cmd::matcher::{delete::DeleteMatcher, main::MainMatcher, Matcher};
use crate::error::ActionError;
#[cfg(feature = "history")]
@ -30,9 +30,9 @@ impl<'a> Delete<'a> {
// Get the share link
let url = matcher_delete.url();
// Create a reqwest client
// TODO: create transfer client when draining downloads
let client = create_client(&matcher_main);
// Create client
let client_config = create_config(&matcher_main);
let client = client_config.client(false);
// Parse the remote file based on the share link, derive the owner token from history
let mut file = RemoteFile::parse_url(url, matcher_delete.owner())?;

View file

@ -19,13 +19,14 @@ use tempfile::{Builder as TempBuilder, NamedTempFile};
use super::select_api_version;
#[cfg(feature = "archive")]
use crate::archive::archive::Archive;
use crate::client::create_transfer_client;
use crate::client::create_config;
use crate::cmd::matcher::{download::DownloadMatcher, main::MainMatcher, Matcher};
#[cfg(feature = "history")]
use crate::history_tool;
use crate::progress::ProgressBar;
use crate::util::{
ensure_enough_space, ensure_password, prompt_yes, quit, quit_error, quit_error_msg, ErrorHints,
ensure_enough_space, ensure_password, follow_url, print_error, prompt_yes, quit, quit_error,
quit_error_msg, ErrorHints,
};
/// A file download action.
@ -46,12 +47,22 @@ impl<'a> Download<'a> {
let matcher_main = MainMatcher::with(self.cmd_matches).unwrap();
let matcher_download = DownloadMatcher::with(self.cmd_matches).unwrap();
// Get the share URL, derive the host
let url = matcher_download.url();
let host = matcher_download.guess_host();
// Create a regular client
let client_config = create_config(&matcher_main);
let client = client_config.clone().client(false);
// Create a reqwest client capable for downloading files
let client = create_transfer_client(&matcher_main);
// Get the share URL, attempt to follow it
let url = matcher_download.url();
let url = match follow_url(&client, &url) {
Ok(url) => url,
Err(err) => {
print_error(err.context("failed to follow share URL, ignoring").compat());
url
}
};
// Guess the host
let host = matcher_download.guess_host(Some(url.clone()));
// Determine the API version to use
let mut desired_version = matcher_main.api();
@ -128,7 +139,7 @@ impl<'a> Download<'a> {
{
// Allocate an archive file, and update the download and target paths
if extract {
// TODO: select the extention dynamically
// TODO: select the extension dynamically
let archive_extention = ".tar";
// Allocate a temporary file to download the archive to
@ -152,7 +163,10 @@ impl<'a> Download<'a> {
// Create a progress bar reporter
let progress_bar = Arc::new(Mutex::new(ProgressBar::new_download()));
let progress_reader: Arc<Mutex<ProgressReporter>> = progress_bar;
let progress_reader: Arc<Mutex<dyn ProgressReporter>> = progress_bar;
// Create a transfer client
let transfer_client = client_config.client(true);
// Execute an download action
let progress = if !matcher_main.quiet() {
@ -161,7 +175,7 @@ impl<'a> Download<'a> {
None
};
ApiDownload::new(api_version, &file, target, password, false, Some(metadata))
.invoke(&client, progress)?;
.invoke(&transfer_client, progress)?;
// Extract the downloaded file if working with an archive
#[cfg(feature = "archive")]
@ -196,7 +210,7 @@ impl<'a> Download<'a> {
///
/// The full path including the name is returned.
///
/// This method will check whether a file is overwitten, and whether
/// This method will check whether a file is overwritten, and whether
/// parent directories must be created.
///
/// The program will quit with an error message if a problem occurs.
@ -299,7 +313,7 @@ impl<'a> Download<'a> {
// Get the path string
let path = target.to_str();
// If the path is emtpy, use the working directory with the name hint
// If the path is empty, use the working directory with the name hint
let use_workdir = path.map(|path| path.trim().is_empty()).unwrap_or(true);
if use_workdir {
match current_dir() {

View file

@ -2,7 +2,7 @@ use clap::ArgMatches;
use ffsend_api::action::exists::{Error as ExistsError, Exists as ApiExists};
use ffsend_api::file::remote_file::{FileParseError, RemoteFile};
use crate::client::create_client;
use crate::client::create_config;
use crate::cmd::matcher::main::MainMatcher;
use crate::cmd::matcher::{exists::ExistsMatcher, Matcher};
use crate::error::ActionError;
@ -31,7 +31,8 @@ impl<'a> Exists<'a> {
let url = matcher_exists.url();
// Create a reqwest client
let client = create_client(&matcher_main);
let client_config = create_config(&matcher_main);
let client = client_config.client(false);
// Parse the remote file based on the share URL
let file = RemoteFile::parse_url(url, None)?;

View file

@ -0,0 +1,61 @@
use std::fs;
use std::io;
use clap::ArgMatches;
use crate::cmd::matcher::{generate::completions::CompletionsMatcher, main::MainMatcher, Matcher};
use crate::error::ActionError;
/// A file completions action.
pub struct Completions<'a> {
cmd_matches: &'a ArgMatches<'a>,
}
impl<'a> Completions<'a> {
/// Construct a new completions action.
pub fn new(cmd_matches: &'a ArgMatches<'a>) -> Self {
Self { cmd_matches }
}
/// Invoke the completions action.
// TODO: create a trait for this method
pub fn invoke(&self) -> Result<(), ActionError> {
// Create the command matchers
let matcher_main = MainMatcher::with(self.cmd_matches).unwrap();
let matcher_completions = CompletionsMatcher::with(self.cmd_matches).unwrap();
// Obtain shells to generate completions for, build application definition
let shells = matcher_completions.shells();
let dir = matcher_completions.output();
let quiet = matcher_main.quiet();
let mut app = crate::cmd::handler::Handler::build();
// If the directory does not exist yet, attempt to create it
if !dir.is_dir() {
fs::create_dir_all(&dir).map_err(Error::CreateOutputDir)?;
}
// Generate completions
for shell in shells {
if !quiet {
eprint!(
"Generating completions for {}...",
format!("{}", shell).to_lowercase()
);
}
app.gen_completions(crate_name!(), shell, &dir);
if !quiet {
eprintln!(" done.");
}
}
Ok(())
}
}
#[derive(Debug, Fail)]
pub enum Error {
/// An error occurred while creating the output directory.
#[fail(display = "failed to create output directory, it doesn't exist")]
CreateOutputDir(#[cause] io::Error),
}

View file

@ -0,0 +1,34 @@
pub mod completions;
use clap::ArgMatches;
use crate::cmd::matcher::{generate::GenerateMatcher, Matcher};
use crate::error::ActionError;
use completions::Completions;
/// A file generate action.
pub struct Generate<'a> {
cmd_matches: &'a ArgMatches<'a>,
}
impl<'a> Generate<'a> {
/// Construct a new generate action.
pub fn new(cmd_matches: &'a ArgMatches<'a>) -> Self {
Self { cmd_matches }
}
/// Invoke the generate action.
// TODO: create a trait for this method
pub fn invoke(&self) -> Result<(), ActionError> {
// Create the command matcher
let matcher_generate = GenerateMatcher::with(self.cmd_matches).unwrap();
// Match shell completions
if matcher_generate.matcher_completions().is_some() {
return Completions::new(self.cmd_matches).invoke();
}
// Unreachable, clap will print help for missing sub command instead
unreachable!()
}
}

View file

@ -1,10 +1,11 @@
use clap::ArgMatches;
use failure::Fail;
use prettytable::{format::FormatBuilder, Cell, Row, Table};
use crate::cmd::matcher::{main::MainMatcher, Matcher};
use crate::cmd::matcher::{history::HistoryMatcher, main::MainMatcher, Matcher};
use crate::error::ActionError;
use crate::history::{History as HistoryManager, LoadError as HistoryLoadError};
use crate::util::format_duration;
use crate::util::{format_duration, quit_error, quit_error_msg, ErrorHintsBuilder};
/// A history action.
pub struct History<'a> {
@ -22,6 +23,7 @@ impl<'a> History<'a> {
pub fn invoke(&self) -> Result<(), ActionError> {
// Create the command matchers
let matcher_main = MainMatcher::with(self.cmd_matches).unwrap();
let matcher_history = HistoryMatcher::with(self.cmd_matches).unwrap();
// Get the history path, make sure it exists
let history_path = matcher_main.history();
@ -33,7 +35,7 @@ impl<'a> History<'a> {
}
// History
let history = HistoryManager::load(history_path)?;
let mut history = HistoryManager::load(history_path)?;
// Do not report any files if there aren't any
if history.files().is_empty() {
@ -43,6 +45,49 @@ impl<'a> History<'a> {
return Ok(());
}
// Clear all history
if matcher_history.clear() {
history.clear();
// Save history
if let Err(err) = history.save() {
quit_error(
err,
ErrorHintsBuilder::default().verbose(true).build().unwrap(),
);
}
eprintln!("History cleared");
return Ok(());
}
// Remove history item
if let Some(url) = matcher_history.rm() {
// Remove item, print error if no item with URL was found
match history.remove_url(url) {
Ok(removed) if !removed => quit_error_msg(
"could not remove item from history, no item matches given URL",
ErrorHintsBuilder::default().verbose(true).build().unwrap(),
),
Err(err) => quit_error(
err.context("could not remove item from history"),
ErrorHintsBuilder::default().verbose(true).build().unwrap(),
),
_ => {}
}
// Save history
if let Err(err) = history.save() {
quit_error(
err,
ErrorHintsBuilder::default().verbose(true).build().unwrap(),
);
}
eprintln!("Item removed from history");
return Ok(());
}
// Get the list of files, and sort the first expiring files to be last
let mut files = history.files().clone();
files.sort_by(|a, b| b.expire_at().cmp(&a.expire_at()));
@ -50,7 +95,7 @@ impl<'a> History<'a> {
// Log a history table, or just the URLs in quiet mode
if !matcher_main.quiet() {
// Build the list of column names
let mut columns = vec!["#", "LINK", "EXPIRY"];
let mut columns = vec!["#", "LINK", "EXPIRE"];
if matcher_main.verbose() {
columns.push("OWNER TOKEN");
}
@ -75,11 +120,8 @@ impl<'a> History<'a> {
};
// Define the cell values
let mut cells: Vec<String> = vec![
format!("{}", i + 1),
file.download_url(true).into_string(),
expiry,
];
let mut cells: Vec<String> =
vec![format!("{}", i + 1), file.download_url(true).into(), expiry];
if matcher_main.verbose() {
cells.push(owner_token);
}

View file

@ -7,7 +7,7 @@ use ffsend_api::action::metadata::Metadata as ApiMetadata;
use ffsend_api::file::remote_file::{FileParseError, RemoteFile};
use prettytable::{format::FormatBuilder, Cell, Row, Table};
use crate::client::create_client;
use crate::client::create_config;
use crate::cmd::matcher::{info::InfoMatcher, main::MainMatcher, Matcher};
#[cfg(feature = "history")]
use crate::history_tool;
@ -37,7 +37,8 @@ impl<'a> Info<'a> {
let url = matcher_info.url();
// Create a reqwest client
let client = create_client(&matcher_main);
let client_config = create_config(&matcher_main);
let client = client_config.client(false);
// Parse the remote file based on the share URL, derive the owner token from history
let mut file = RemoteFile::parse_url(url, matcher_info.owner())?;

View file

@ -2,6 +2,7 @@ pub mod debug;
pub mod delete;
pub mod download;
pub mod exists;
pub mod generate;
#[cfg(feature = "history")]
pub mod history;
pub mod info;
@ -12,9 +13,9 @@ pub mod version;
use ffsend_api::action::version::{Error as VersionError, Version as ApiVersion};
use ffsend_api::api::DesiredVersion;
use ffsend_api::client::Client;
use ffsend_api::url::Url;
use crate::client::Client;
use crate::config::API_VERSION_ASSUME;
use crate::util::print_warning;
@ -49,7 +50,7 @@ fn select_api_version(
));
}
// Propegate other errors
// Propagate other errors
Err(e) => return Err(e),
}

View file

@ -2,7 +2,8 @@ use clap::ArgMatches;
use ffsend_api::action::params::{Error as ParamsError, Params as ApiParams, ParamsDataBuilder};
use ffsend_api::file::remote_file::RemoteFile;
use crate::client::create_client;
use super::select_api_version;
use crate::client::create_config;
use crate::cmd::matcher::{main::MainMatcher, params::ParamsMatcher, Matcher};
use crate::error::ActionError;
#[cfg(feature = "history")]
@ -27,11 +28,22 @@ impl<'a> Params<'a> {
let matcher_main = MainMatcher::with(self.cmd_matches).unwrap();
let matcher_params = ParamsMatcher::with(self.cmd_matches).unwrap();
// Get the share URL
// Get the share URL and the host
// TODO: derive host through helper function
let url = matcher_params.url();
let mut host = url.clone();
host.set_path("");
host.set_query(None);
host.set_fragment(None);
// Create a reqwest client
let client = create_client(&matcher_main);
let client_config = create_config(&matcher_main);
let client = client_config.client(false);
// Determine the API version to use
let mut desired_version = matcher_main.api();
select_api_version(&client, host, &mut desired_version)?;
let api_version = desired_version.version().unwrap();
// Parse the remote file based on the share URL, derive the owner token from history
let mut file = RemoteFile::parse_url(url, matcher_params.owner())?;
@ -41,9 +53,16 @@ impl<'a> Params<'a> {
// Ensure the owner token is set
ensure_owner_token(file.owner_token_mut(), &matcher_main, false);
// We don't authenticate for now
let auth = false;
// Build the parameters data object
let data = ParamsDataBuilder::default()
.download_limit(matcher_params.download_limit())
.download_limit(
matcher_params
.download_limit(&matcher_main, api_version, auth)
.map(|d| d as u8),
)
.build()
.unwrap();

View file

@ -3,7 +3,7 @@ use ffsend_api::action::password::{Error as PasswordError, Password as ApiPasswo
use ffsend_api::file::remote_file::RemoteFile;
use prettytable::{format::FormatBuilder, Cell, Row, Table};
use crate::client::create_client;
use crate::client::create_config;
use crate::cmd::matcher::{main::MainMatcher, password::PasswordMatcher, Matcher};
use crate::error::ActionError;
#[cfg(feature = "history")]
@ -32,7 +32,8 @@ impl<'a> Password<'a> {
let url = matcher_password.url();
// Create a reqwest client
let client = create_client(&matcher_main);
let client_config = create_config(&matcher_main);
let client = client_config.client(false);
// Parse the remote file based on the share URL, derive the owner token from history
let mut file = RemoteFile::parse_url(url, matcher_password.owner())?;

View file

@ -1,7 +1,11 @@
use std::fs::File;
#[cfg(feature = "archive")]
use std::io::Error as IoError;
use std::env::current_dir;
use std::fs;
use std::io::{Error as IoError, Write};
use std::path::Path;
#[cfg(feature = "archive")]
use std::path::PathBuf;
#[cfg(feature = "archive")]
use std::process::exit;
use std::sync::{Arc, Mutex};
use clap::ArgMatches;
@ -11,23 +15,27 @@ use ffsend_api::action::upload::{Error as UploadError, Upload as ApiUpload};
use ffsend_api::action::version::Error as VersionError;
use ffsend_api::config::{upload_size_max, UPLOAD_SIZE_MAX_RECOMMENDED};
use ffsend_api::pipe::ProgressReporter;
use pathdiff::diff_paths;
use prettytable::{format::FormatBuilder, Cell, Row, Table};
#[cfg(feature = "archive")]
#[cfg(feature = "qrcode")]
use qr2term::print_qr;
use tempfile::{Builder as TempBuilder, NamedTempFile};
use super::select_api_version;
#[cfg(feature = "archive")]
use crate::archive::archiver::Archiver;
use crate::client::create_transfer_client;
use crate::client::create_config;
use crate::cmd::matcher::{MainMatcher, Matcher, UploadMatcher};
#[cfg(feature = "history")]
use crate::history_tool;
use crate::progress::ProgressBar;
#[cfg(feature = "urlshorten")]
use crate::urlshorten;
#[cfg(feature = "clipboard")]
use crate::util::set_clipboard;
use crate::util::{
format_bytes, open_url, print_error, print_error_msg, prompt_yes, quit, quit_error_msg,
ErrorHintsBuilder,
rand_alphanum_string, stdin_read_file, ErrorHintsBuilder, StdinErr,
};
/// A file upload action.
@ -48,88 +56,60 @@ impl<'a> Upload<'a> {
let matcher_main = MainMatcher::with(self.cmd_matches).unwrap();
let matcher_upload = UploadMatcher::with(self.cmd_matches).unwrap();
// Get API parameters
#[allow(unused_mut)]
let mut path = Path::new(matcher_upload.file()).to_path_buf();
let host = matcher_upload.host();
// Create a reqwest client capable for uploading files
let client = create_transfer_client(&matcher_main);
// Determine the API version to use
let mut desired_version = matcher_main.api();
select_api_version(&client, host.clone(), &mut desired_version)?;
let api_version = desired_version.version().unwrap();
// TODO: ensure the file exists and is accessible
// Determine the max file size
// TODO: set false parameter to authentication state
let max_size = upload_size_max(api_version, false);
// Get the file size to warn about large files
if let Ok(size) = File::open(&path)
.and_then(|f| f.metadata())
.map(|m| m.len())
{
if size > max_size && !matcher_main.force() {
// The file is too large, show an error and quit
quit_error_msg(
format!(
"the file size is {}, bigger than the maximum allowed of {}",
format_bytes(size),
format_bytes(max_size),
),
ErrorHintsBuilder::default()
.force(true)
.verbose(false)
.build()
.unwrap(),
);
} else if size > UPLOAD_SIZE_MAX_RECOMMENDED && !matcher_main.force() {
// The file is larger than the recommended maximum, warn
eprintln!(
"The file size is {}, bigger than the recommended maximum of {}",
format_bytes(size),
format_bytes(UPLOAD_SIZE_MAX_RECOMMENDED),
);
// Prompt the user to continue, quit if the user answered no
if !prompt_yes("Continue uploading?", Some(true), &matcher_main) {
println!("Upload cancelled");
quit();
}
}
} else {
print_error_msg("failed to check the file size, ignoring");
}
// Create a reqwest client capable for uploading files
let transfer_client = create_transfer_client(&matcher_main);
// Create a progress bar reporter
let progress_bar = Arc::new(Mutex::new(ProgressBar::new_upload()));
// Build a parameters object to set for the file
let params = {
// Build the parameters data object
let params = ParamsDataBuilder::default()
.download_limit(matcher_upload.download_limit())
.build()
.unwrap();
// Wrap the data in an option if not empty
if params.is_empty() {
None
} else {
Some(params)
}
};
// The file name to use
#[allow(unused_mut)]
let mut file_name = matcher_upload.name().map(|s| s.to_owned());
// The selected files
let mut files = matcher_upload.files();
// If file is `-`, upload from stdin
// TODO: write stdin directly to file, or directly to upload buffer
let mut tmp_stdin: Option<NamedTempFile> = None;
if files.len() == 1 && files[0] == "-" {
// Obtain data from stdin
let data = stdin_read_file(!matcher_main.quiet()).map_err(Error::Stdin)?;
// Create temporary stdin buffer file
tmp_stdin = Some(
TempBuilder::new()
.prefix(&format!(".{}-stdin-", crate_name!()))
.tempfile()
.map_err(Error::StdinTempFile)?,
);
let file = tmp_stdin.as_ref().unwrap();
// Fill temporary file with data, update list of files we upload, suggest name
file.as_file()
.write_all(&data)
.map_err(Error::StdinTempFile)?;
files = vec![file
.path()
.to_str()
.expect("failed to obtain file name for stdin buffer file")];
file_name = file_name.or_else(|| Some("stdin.txt".into()));
}
// Get API parameters
#[allow(unused_mut)]
let mut paths: Vec<_> = files
.into_iter()
.map(|p| Path::new(p).to_path_buf())
.collect();
let mut path = Path::new(paths.first().unwrap()).to_path_buf();
let host = matcher_upload.host();
// All paths must exist
// TODO: ensure the file exists and is accessible
for path in &paths {
if !path.exists() {
quit_error_msg(
format!("the path '{}' does not exist", path.to_str().unwrap_or("?")),
ErrorHintsBuilder::default().build().unwrap(),
);
}
}
// A temporary archive file, only used when archiving
// The temporary file is stored here, to ensure it's lifetime exceeds the upload process
#[allow(unused_mut)]
@ -138,16 +118,31 @@ impl<'a> Upload<'a> {
#[cfg(feature = "archive")]
{
// Determine whether to archive, ask if a directory was selected
// Determine whether to archive, we must archive for multiple files/directory
let mut archive = matcher_upload.archive();
if !archive && path.is_dir() {
if prompt_yes(
"You've selected a directory, only a single file may be uploaded.\n\
Archive the directory into a single file?",
Some(true),
&matcher_main,
) {
archive = true;
if !archive {
if paths.len() > 1 {
if prompt_yes(
"You've selected multiple files, only a single file may be uploaded.\n\
Archive the files into a single file?",
Some(true),
&matcher_main,
) {
archive = true;
} else {
exit(1);
}
} else if path.is_dir() {
if prompt_yes(
"You've selected a directory, only a single file may be uploaded.\n\
Archive the directory into a single file?",
Some(true),
&matcher_main,
) {
archive = true;
} else {
exit(1);
}
}
}
@ -174,37 +169,194 @@ impl<'a> Upload<'a> {
// Select the file name to use if not set
if file_name.is_none() {
file_name = Some(
path.canonicalize()
.map_err(|err| ArchiveError::FileName(Some(err)))?
.file_name()
.ok_or(ArchiveError::FileName(None))?
.to_str()
.map(|s| s.to_owned())
.ok_or(ArchiveError::FileName(None))?,
);
// Derive name from given file
if paths.len() == 1 {
file_name = Some(
path.canonicalize()
.map_err(|err| ArchiveError::FileName(Some(err)))?
.file_name()
.ok_or(ArchiveError::FileName(None))?
.to_str()
.map(|s| s.to_owned())
.ok_or(ArchiveError::FileName(None))?,
);
} else {
// Unable to derive file name from paths, generate random
file_name = Some(format!("ffsend-archive-{}", rand_alphanum_string(8)));
}
}
// Build an archiver and append the file
// Get the current working directory, including working directory as highest possible root, canonicalize it
let working_dir =
current_dir().expect("failed to get current working directory");
let shared_dir = {
let mut paths = paths.clone();
paths.push(working_dir.clone());
match shared_dir(paths) {
Some(p) => p,
None => quit_error_msg(
"when archiving, all files must be within a same directory",
ErrorHintsBuilder::default().verbose(false).build().unwrap(),
),
}
};
// Build an archiver, append each file
let mut archiver = Archiver::new(archive_file);
archiver
.append_path(file_name.as_ref().unwrap(), &path)
.map_err(ArchiveError::AddFile)?;
for path in &paths {
// Canonicalize the path
let mut path = Path::new(path).to_path_buf();
if let Ok(p) = path.canonicalize() {
path = p;
}
// Find relative name to share dir, used to derive name from
let name = diff_paths(&path, &shared_dir)
.expect("failed to determine relative path of file to archive");
let name = name.to_str().expect("failed to get file path");
// Add file to archiver
archiver
.append_path(name, &path)
.map_err(ArchiveError::AddFile)?;
}
// Finish the archival process, writes the archive file
archiver.finish().map_err(ArchiveError::Write)?;
// Append archive extention to name, set to upload archived file
// Append archive extension to name, set to upload archived file
if let Some(ref mut file_name) = file_name {
file_name.push_str(archive_extention);
}
path = archive_path;
paths.clear();
}
}
}
// Quit with error when uploading multiple files or directory, if we cannot archive
#[cfg(not(feature = "archive"))]
{
if paths.len() > 1 {
quit_error_msg(
"uploading multiple files is not supported, ffsend must be compiled with 'archive' feature for this",
ErrorHintsBuilder::default()
.verbose(false)
.build()
.unwrap(),
);
}
if path.is_dir() {
quit_error_msg(
"uploading a directory is not supported, ffsend must be compiled with 'archive' feature for this",
ErrorHintsBuilder::default()
.verbose(false)
.build()
.unwrap(),
);
}
}
// Create a reqwest client capable for uploading files
let client_config = create_config(&matcher_main);
let client = client_config.clone().client(false);
// Determine the API version to use
let mut desired_version = matcher_main.api();
select_api_version(&client, host.clone(), &mut desired_version)?;
let api_version = desired_version.version().unwrap();
// We do not authenticate for now
let auth = false;
// TODO: extract this into external function
{
// Determine the max file size
// TODO: set false parameter to authentication state
let max_size = upload_size_max(api_version, auth);
// Get the file size, fail on empty files, warn about large files
if let Ok(size) = path.metadata().map(|m| m.len()) {
// Enforce files not being 0 bytes
if size == 0 && !matcher_main.force() {
quit_error_msg(
"uploading a file with a size of 0 bytes is not supported",
ErrorHintsBuilder::default()
.force(true)
.verbose(false)
.build()
.unwrap(),
)
}
// Enforce maximum file size
if size > max_size && !matcher_main.force() {
// The file is too large, show an error and quit
quit_error_msg(
format!(
"the file size is {}, bigger than the maximum allowed of {}",
format_bytes(size),
format_bytes(max_size),
),
ErrorHintsBuilder::default()
.force(true)
.verbose(false)
.build()
.unwrap(),
);
}
// Enforce maximum recommended size
if size > UPLOAD_SIZE_MAX_RECOMMENDED && !matcher_main.force() {
// The file is larger than the recommended maximum, warn
eprintln!(
"The file size is {}, bigger than the recommended maximum of {}",
format_bytes(size),
format_bytes(UPLOAD_SIZE_MAX_RECOMMENDED),
);
// Prompt the user to continue, quit if the user answered no
if !prompt_yes("Continue uploading?", Some(true), &matcher_main) {
eprintln!("Upload cancelled");
quit();
}
}
} else {
print_error_msg("failed to check the file size, ignoring");
}
}
// TODO: assert max expiry time for file
// Create a reqwest client capable for uploading files
let transfer_client = client_config.client(true);
// Create a progress bar reporter
let progress_bar = Arc::new(Mutex::new(ProgressBar::new_upload()));
// Build a parameters object to set for the file
let params = {
// Build the parameters data object
let params = ParamsDataBuilder::default()
.download_limit(
matcher_upload
.download_limit(&matcher_main, api_version, auth)
.map(|d| d as u8),
)
.expiry_time(matcher_upload.expiry_time(&matcher_main, api_version, auth))
.build()
.unwrap();
// Wrap the data in an option if not empty
if params.is_empty() {
None
} else {
Some(params)
}
};
// Build the progress reporter
let progress_reporter: Arc<Mutex<ProgressReporter>> = progress_bar;
let progress_reporter: Arc<Mutex<dyn ProgressReporter>> = progress_bar;
// Get the password to use and whether it was generated
let password = matcher_upload.password();
@ -226,29 +378,72 @@ impl<'a> Upload<'a> {
params,
)
.invoke(&transfer_client, reporter)?;
let url = file.download_url(true);
#[allow(unused_mut)]
let mut url = file.download_url(true);
// Shorten the share URL if requested, prompt the user to confirm
#[cfg(feature = "urlshorten")]
{
if matcher_upload.shorten() {
if prompt_yes("URL shortening is a security risk. This shares the secret URL with a 3rd party.\nDo you want to shorten the share URL?", Some(false), &matcher_main) {
match urlshorten::shorten_url(&client, &url) {
Ok(short) => url = short,
Err(err) => print_error(
err.context("failed to shorten share URL, ignoring")
.compat(),
),
}
}
}
}
// Report the result
if !matcher_main.quiet() {
// Show a table
// Create a table
let mut table = Table::new();
table.set_format(FormatBuilder::new().padding(0, 2).build());
table.add_row(Row::new(vec![
Cell::new("Share link:"),
Cell::new(url.as_str()),
]));
if password_generated {
table.add_row(Row::new(vec![
Cell::new("Passphrase:"),
Cell::new(&password.unwrap_or("?".into())),
]));
// Show the original URL when shortening, verbose and different
#[cfg(feature = "urlshorten")]
{
let full_url = file.download_url(true);
if matcher_main.verbose() && matcher_upload.shorten() && url != full_url {
table.add_row(Row::new(vec![
Cell::new("Full share link:"),
Cell::new(full_url.as_str()),
]));
}
}
if matcher_main.verbose() {
// Show the share URL
table.add_row(Row::new(vec![
Cell::new("Share link:"),
Cell::new(url.as_str()),
]));
// Show a generate passphrase
if password_generated {
table.add_row(Row::new(vec![
Cell::new("Passphrase:"),
Cell::new(&password.unwrap_or("?".into())),
]));
}
// Show the owner token
table.add_row(Row::new(vec![
Cell::new("Owner token:"),
Cell::new(file.owner_token().unwrap()),
]));
} else {
table.add_row(Row::new(vec![Cell::new(url.as_str())]));
// Show a generate passphrase
if password_generated {
table.add_row(Row::new(vec![Cell::new(&password.unwrap_or("?".into()))]));
}
}
table.printstd();
} else {
println!("{}", url);
@ -277,6 +472,26 @@ impl<'a> Upload<'a> {
}
}
// Print a QR code for the share URL
#[cfg(feature = "qrcode")]
{
if matcher_upload.qrcode() {
if let Err(err) = print_qr(url.as_str()) {
print_error(err.context("failed to print QR code, ignoring").compat());
}
}
}
// Close the temporary stdin buffer file, to ensure it's removed
if let Some(tmp_stdin) = tmp_stdin.take() {
if let Err(err) = tmp_stdin.close() {
print_error(
err.context("failed to clean up temporary stdin buffer file, ignoring")
.compat(),
);
}
}
#[cfg(feature = "archive")]
{
// Close the temporary zip file, to ensure it's removed
@ -290,10 +505,101 @@ impl<'a> Upload<'a> {
}
}
// Delete local files after uploading
if matcher_upload.delete() {
for path in &paths {
if path.is_file() {
if let Err(err) = fs::remove_file(path) {
print_error(
Error::Delete(err)
.context("failed to delete local file after upload, ignoring")
.compat(),
);
}
} else {
if let Err(err) = fs::remove_dir_all(path) {
print_error(
Error::Delete(err)
.context("failed to delete local directory after upload, ignoring")
.compat(),
);
}
}
}
}
Ok(())
}
}
/// Find the deepest directory all given paths share.
///
/// This function canonicalizes the paths, make sure the paths exist.
///
/// Returns `None` if paths are using a different root.
///
/// # Examples
///
/// If the following paths are given:
///
/// - `/home/user/git/ffsend/src`
/// - `/home/user/git/ffsend/src/main.rs`
/// - `/home/user/git/ffsend/Cargo.toml`
///
/// The following is returned:
///
/// `/home/user/git/ffsend`
#[cfg(feature = "archive")]
fn shared_dir(paths: Vec<PathBuf>) -> Option<PathBuf> {
// Any path must be given
if paths.is_empty() {
return None;
}
// Build vector
let c: Vec<Vec<PathBuf>> = paths
.into_iter()
.map(|p| p.canonicalize().expect("failed to canonicalize path"))
.map(|mut p| {
// Start with parent if current path is file
if p.is_file() {
p = match p.parent() {
Some(p) => p.to_path_buf(),
None => return vec![],
};
}
// Build list of path buffers for each path component
let mut items = vec![p];
#[allow(mutable_borrow_reservation_conflict)]
while let Some(item) = items.last().unwrap().parent() {
items.push(item.to_path_buf());
}
// Reverse as we built it in the wrong order
items.reverse();
items
})
.collect();
// Find the index at which the paths are last shared at by walking through indices
let i = (0..)
.take_while(|i| {
// Get path for first item, stop if none
let base = &c[0].get(*i);
if base.is_none() {
return false;
};
// All other paths must equal at this index
c.iter().skip(1).all(|p| &p.get(*i) == base)
})
.last();
// Find the shared path
i.map(|i| c[0][i].to_path_buf())
}
#[derive(Debug, Fail)]
pub enum Error {
/// Selecting the API version to use failed.
@ -309,6 +615,18 @@ pub enum Error {
/// An error occurred while uploading the file.
#[fail(display = "")]
Upload(#[cause] UploadError),
/// An error occurred while deleting a local file after upload.
#[fail(display = "failed to delete local file")]
Delete(#[cause] IoError),
/// An error occurred while reading data from stdin.
#[fail(display = "failed to read data from stdin")]
Stdin(#[cause] StdinErr),
/// An error occurred while creating the temporary stdin file.
#[fail(display = "failed to create temporary stdin buffer file")]
StdinTempFile(#[cause] IoError),
}
impl From<VersionError> for Error {

View file

@ -1,7 +1,7 @@
use clap::ArgMatches;
use ffsend_api::action::version::{Error as VersionError, Version as ApiVersion};
use crate::client::create_client;
use crate::client::create_config;
use crate::cmd::matcher::main::MainMatcher;
use crate::cmd::matcher::{version::VersionMatcher, Matcher};
use crate::error::ActionError;
@ -28,7 +28,8 @@ impl<'a> Version<'a> {
let host = matcher_version.host();
// Create a reqwest client
let client = create_client(&matcher_main);
let client_config = create_config(&matcher_main);
let client = client_config.client(false);
// Make sure the file version
let response = ApiVersion::new(host).invoke(&client);

View file

@ -1,7 +1,7 @@
use std::io::{Error as IoError, Read};
use std::path::Path;
use super::tar::Archive as TarArchive;
use tar::Archive as TarArchive;
pub type Result<T> = ::std::result::Result<T, IoError>;

View file

@ -2,7 +2,7 @@ use std::fs::File;
use std::io::{Error as IoError, Write};
use std::path::Path;
use super::tar::Builder as TarBuilder;
use tar::Builder as TarBuilder;
pub type Result<T> = ::std::result::Result<T, IoError>;

View file

@ -1,4 +1,2 @@
extern crate tar;
pub mod archive;
pub mod archiver;

View file

@ -1,30 +1,22 @@
use std::time::Duration;
pub use ffsend_api::reqwest::Client;
use ffsend_api::reqwest::ClientBuilder;
use ffsend_api::client::{ClientConfig, ClientConfigBuilder};
use crate::cmd::matcher::MainMatcher;
/// Create the default client, which is used for generic Send requests.
/// Create a client configuration for ffsend actions.
///
/// Note: use `create_transfer_client()` instead for clients that upload/download.
pub fn create_client(matcher_main: &MainMatcher) -> Client {
create_custom_client(to_duration(matcher_main.timeout()))
}
/// Create the default client, which is used for generic Send requests.
///
/// Note: use `create_transfer_client()` instead for clients that upload/download.
pub fn create_transfer_client(matcher_main: &MainMatcher) -> Client {
create_custom_client(to_duration(matcher_main.transfer_timeout()))
}
/// Create the Send client with a custom timeout.
fn create_custom_client(timeout: Option<Duration>) -> Client {
ClientBuilder::new()
.timeout(timeout)
/// A client configuration allows you to build a client, which must be passed to ffsend API
/// actions.
// TODO: properly handle errors, do not unwrap
pub fn create_config(matcher_main: &MainMatcher) -> ClientConfig {
// TODO: configure HTTP authentication properties
ClientConfigBuilder::default()
.timeout(to_duration(matcher_main.timeout()))
.transfer_timeout(to_duration(matcher_main.transfer_timeout()))
.basic_auth(matcher_main.basic_auth())
.build()
.expect("failed to build custom reqwest client")
.expect("failed to create network client configuration")
}
/// Convert the given number of seconds into an optional duration, used for clients.

View file

@ -24,7 +24,7 @@ impl CmdArg for ArgApi {
.help("Server API version to use, '-' to lookup")
.long_help(
"Server API version to use, one of:\n\
2, 3: Firefox Send API versions\n\
2, 3: Send API versions\n\
auto, -: probe server to determine\
",
)

44
src/cmd/arg/basic_auth.rs Normal file
View file

@ -0,0 +1,44 @@
use clap::{Arg, ArgMatches};
use super::{CmdArg, CmdArgOption};
/// The basicauth argument.
pub struct ArgBasicAuth {}
impl CmdArg for ArgBasicAuth {
fn name() -> &'static str {
"basic-auth"
}
fn build<'b, 'c>() -> Arg<'b, 'c> {
Arg::with_name("basic-auth")
.long("basic-auth")
.alias("basic-authentication")
.alias("http-basic-authentication")
.alias("http-basic-auth")
.value_name("USER:PASSWORD")
.env("FFSEND_BASIC_AUTH")
.hide_env_values(true)
.global(true)
.help("Protected proxy HTTP basic authentication credentials (not FxA)")
}
}
impl<'a> CmdArgOption<'a> for ArgBasicAuth {
type Value = Option<(String, Option<String>)>;
fn value<'b: 'a>(matches: &'a ArgMatches<'b>) -> Self::Value {
// Get the authentication credentials
let raw = match Self::value_raw(matches) {
Some(raw) => raw,
None => return None,
};
// Split the properties
let mut iter = raw.splitn(2, ':');
Some((
iter.next().unwrap_or("").to_owned(),
iter.next().map(|pass| pass.to_owned()),
))
}
}

View file

@ -1,15 +1,61 @@
use clap::{Arg, ArgMatches};
use ffsend_api::action::params::{
PARAMS_DOWNLOAD_MAX as DOWNLOAD_MAX, PARAMS_DOWNLOAD_MIN as DOWNLOAD_MIN,
};
use ffsend_api::api::Version as ApiVersion;
use ffsend_api::config::downloads_max;
use super::{CmdArg, CmdArgFlag, CmdArgOption};
use crate::util::{quit_error_msg, ErrorHintsBuilder};
use crate::cmd::matcher::MainMatcher;
use crate::util::{highlight, prompt_yes, quit};
/// The download limit argument.
pub struct ArgDownloadLimit {}
impl ArgDownloadLimit {
pub fn value_checked<'a>(
matches: &ArgMatches<'a>,
main_matcher: &MainMatcher,
api_version: ApiVersion,
auth: bool,
) -> Option<usize> {
// Get the download value
let mut downloads = Self::value(matches)?;
// Get number of allowed downloads, return if allowed or when forcing
let allowed = downloads_max(api_version, auth);
if allowed.contains(&downloads) || main_matcher.force() {
return Some(downloads);
}
// Prompt the user the specified downloads limit is invalid
let allowed_str = allowed
.iter()
.map(|value| format!("{}", value))
.collect::<Vec<_>>()
.join(", ");
eprintln!("The downloads limit must be one of: {}", allowed_str);
if auth {
eprintln!("Use '{}' to force", highlight("--force"));
} else {
eprintln!(
"Use '{}' to force, authenticate for higher limits",
highlight("--force")
);
}
// Ask to use closest limit, quit if user cancelled
let closest = closest(allowed, downloads);
if !prompt_yes(
&format!("Would you like to limit downloads to {} instead?", closest),
None,
main_matcher,
) {
quit();
}
downloads = closest;
Some(downloads)
}
}
impl CmdArg for ArgDownloadLimit {
fn name() -> &'static str {
"download-limit"
@ -22,6 +68,7 @@ impl CmdArg for ArgDownloadLimit {
.alias("downloads")
.alias("download")
.value_name("COUNT")
.env("FFSEND_DOWNLOAD_LIMIT")
.help("The file download limit")
}
}
@ -29,30 +76,26 @@ impl CmdArg for ArgDownloadLimit {
impl CmdArgFlag for ArgDownloadLimit {}
impl<'a> CmdArgOption<'a> for ArgDownloadLimit {
type Value = Option<u8>;
type Value = Option<usize>;
fn value<'b: 'a>(matches: &'a ArgMatches<'b>) -> Self::Value {
// TODO: do not unwrap, report an error
Self::value_raw(matches)
.map(|d| d.parse::<u8>().expect("invalid download limit"))
.and_then(|d| {
// Check the download limit bounds
// TODO: somehow allow to force a different number here
if d < DOWNLOAD_MIN || d > DOWNLOAD_MAX {
quit_error_msg(
format!(
"invalid download limit, must be between {} and {}",
DOWNLOAD_MIN, DOWNLOAD_MAX,
),
ErrorHintsBuilder::default()
.force(false)
.verbose(false)
.build()
.unwrap(),
);
}
Some(d)
})
Self::value_raw(matches).map(|d| d.parse::<usize>().expect("invalid download limit"))
}
}
/// Find the closest value to `current` in the given `values` range.
fn closest(values: &[usize], current: usize) -> usize {
// Own the values, sort and reverse, start with biggest first
let mut values = values.to_vec();
values.sort_unstable();
// Find the closest value, return it
*values
.iter()
.rev()
.map(|value| (value, (current as i64 - *value as i64).abs()))
.min_by_key(|value| value.1)
.expect("failed to find closest value, none given")
.0
}

View file

@ -0,0 +1,97 @@
use chrono::Duration;
use clap::{Arg, ArgMatches};
use failure::Fail;
use ffsend_api::api::Version as ApiVersion;
use ffsend_api::config::expiry_max;
use super::{CmdArg, CmdArgFlag, CmdArgOption};
use crate::cmd::matcher::MainMatcher;
use crate::util::{
format_duration, highlight, parse_duration, prompt_yes, quit, quit_error, ErrorHints,
};
/// The download limit argument.
pub struct ArgExpiryTime {}
impl ArgExpiryTime {
pub fn value_checked<'a>(
matches: &ArgMatches<'a>,
main_matcher: &MainMatcher,
api_version: ApiVersion,
auth: bool,
) -> Option<usize> {
// Get the expiry time value
let mut expiry = Self::value(matches)?;
// Get expiry time, return if allowed or when forcing
let max = *expiry_max(api_version, auth).into_iter().max().unwrap();
if expiry <= max || main_matcher.force() {
return Some(expiry);
}
// Define function to format seconds
let format_secs = |secs: usize| format_duration(Duration::seconds(secs as i64));
// Prompt the user the specified expiry time is invalid
eprintln!(
"The expiry time must equal to or less than: {}",
format_secs(max),
);
if auth {
eprintln!("Use '{}' to force", highlight("--force"));
} else {
eprintln!(
"Use '{}' to force, authenticate for higher limits",
highlight("--force")
);
}
// Ask to use maximum expiry time instead, quit if user cancelled
if !prompt_yes(
&format!(
"Would you like to set expiry time to {} instead?",
format_secs(max),
),
None,
main_matcher,
) {
quit();
}
expiry = max;
Some(expiry)
}
}
impl CmdArg for ArgExpiryTime {
fn name() -> &'static str {
"expiry-time"
}
fn build<'b, 'c>() -> Arg<'b, 'c> {
Arg::with_name("expiry-time")
.long("expiry-time")
.short("e")
.alias("expire")
.alias("expiry")
.value_name("TIME")
.env("FFSEND_EXPIRY_TIME")
.help("The file expiry time")
}
}
impl CmdArgFlag for ArgExpiryTime {}
impl<'a> CmdArgOption<'a> for ArgExpiryTime {
type Value = Option<usize>;
fn value<'b: 'a>(matches: &'a ArgMatches<'b>) -> Self::Value {
Self::value_raw(matches).map(|t| match parse_duration(t) {
Ok(seconds) => seconds,
Err(err) => quit_error(
err.context("specified invalid file expiry time"),
ErrorHints::default(),
),
})
}
}

View file

@ -1,26 +1,16 @@
use chbs::{
config::BasicConfig,
prelude::*,
word::WordList,
};
use chbs;
use clap::Arg;
use super::{CmdArg, CmdArgFlag};
/// How many words the passphrase should consist of.
const PASSPHRASE_WORDS: usize = 5;
/// The passphrase generation argument.
pub struct ArgGenPassphrase {}
impl ArgGenPassphrase {
/// Generate a cryptographically secure passphrase that is easily
/// rememberable using diceware.
/// remembered using diceware.
pub fn gen_passphrase() -> String {
let mut config = BasicConfig::default();
config.words = PASSPHRASE_WORDS;
config.word_provider = WordList::builtin_eff_general_short().sampler();
config.to_scheme().generate()
chbs::passphrase()
}
}
@ -36,6 +26,7 @@ impl CmdArg for ArgGenPassphrase {
.alias("generate-passphrase")
.alias("generate-password")
.short("P")
.conflicts_with("password")
.help("Protect the file with a generated passphrase")
}
}

View file

@ -1,6 +1,5 @@
use clap::{Arg, ArgMatches};
use failure::Fail;
use ffsend_api::config::SEND_DEFAULT_HOST;
use ffsend_api::url::Url;
use super::{CmdArg, CmdArgOption};
@ -20,7 +19,7 @@ impl CmdArg for ArgHost {
.long("host")
.short("h")
.value_name("URL")
.default_value(SEND_DEFAULT_HOST)
.default_value("https://send.vis.ee/")
.env("FFSEND_HOST")
.hide_env_values(true)
.help("The remote host to upload to")

View file

@ -1,14 +1,18 @@
pub mod api;
pub mod basic_auth;
pub mod download_limit;
pub mod expiry_time;
pub mod gen_passphrase;
pub mod host;
pub mod owner;
pub mod password;
pub mod url;
// Re-eexport to arg module
// Re-export to arg module
pub use self::api::ArgApi;
pub use self::basic_auth::ArgBasicAuth;
pub use self::download_limit::ArgDownloadLimit;
pub use self::expiry_time::ArgExpiryTime;
pub use self::gen_passphrase::ArgGenPassphrase;
pub use self::host::ArgHost;
pub use self::owner::ArgOwner;

View file

@ -1,23 +1,29 @@
extern crate directories;
#[cfg(feature = "infer-command")]
use std::ffi::OsString;
use clap::{App, AppSettings, Arg, ArgMatches};
use super::arg::{ArgApi, CmdArg};
use super::arg::{ArgApi, ArgBasicAuth, CmdArg};
#[cfg(feature = "history")]
use super::matcher::HistoryMatcher;
use super::matcher::{
DebugMatcher, DeleteMatcher, DownloadMatcher, ExistsMatcher, InfoMatcher, Matcher,
ParamsMatcher, PasswordMatcher, UploadMatcher, VersionMatcher,
DebugMatcher, DeleteMatcher, DownloadMatcher, ExistsMatcher, GenerateMatcher, InfoMatcher,
Matcher, ParamsMatcher, PasswordMatcher, UploadMatcher, VersionMatcher,
};
#[cfg(feature = "history")]
use super::subcmd::CmdHistory;
use super::subcmd::{
CmdDebug, CmdDelete, CmdDownload, CmdExists, CmdInfo, CmdParams, CmdPassword, CmdUpload,
CmdVersion,
CmdDebug, CmdDelete, CmdDownload, CmdExists, CmdGenerate, CmdInfo, CmdParams, CmdPassword,
CmdUpload, CmdVersion,
};
#[cfg(feature = "infer-command")]
use crate::config::INFER_COMMANDS;
use crate::config::{CLIENT_TIMEOUT, CLIENT_TRANSFER_TIMEOUT};
#[cfg(feature = "history")]
use crate::util::app_history_file_path_string;
#[cfg(feature = "infer-command")]
use crate::util::bin_name;
use crate::util::parse_duration;
#[cfg(feature = "history")]
lazy_static! {
@ -31,6 +37,15 @@ lazy_static! {
/// The default client transfer timeout in seconds as a string
static ref DEFAULT_TRANSFER_TIMEOUT: String = format!("{}", CLIENT_TRANSFER_TIMEOUT);
/// The about notice in command output.
static ref APP_ABOUT: String = format!(
"{}\n\n\
The default public Send host is provided by Tim Visee, @timvisee.\n\
Please consider to donate and help keep it running: https://vis.ee/donate\
",
crate_description!(),
);
}
/// CLI argument handler.
@ -46,13 +61,8 @@ impl<'a: 'b, 'b> Handler<'a> {
let app = App::new(crate_name!())
.version(crate_version!())
.author(crate_authors!())
.about(crate_description!())
.after_help(
"\
The public Send service that is used as default host is provided by Mozilla.\n\
This application is not affiliated with Mozilla, Firefox or Firefox Send.\
",
)
.about(APP_ABOUT.as_ref())
.after_help("This application is not affiliated with Firefox or Mozilla.")
.global_setting(AppSettings::GlobalVersion)
.global_setting(AppSettings::VersionlessSubcommands)
// TODO: enable below command when it doesn't break `p` anymore.
@ -93,13 +103,13 @@ impl<'a: 'b, 'b> Handler<'a> {
.hide_default_value(true)
.env("FFSEND_TIMEOUT")
.hide_env_values(true)
.validator(|arg| arg
.parse::<u64>()
.map(|_| ())
.map_err(|_| String::from(
"Timeout time must be a positive number of seconds, or 0 to disable."
))
),
.validator(|arg| {
parse_duration(&arg).map(drop).map_err(|_| {
String::from(
"Timeout time must be a positive number of seconds, or 0 to disable."
)
})
}),
)
.arg(
Arg::with_name("transfer-timeout")
@ -118,13 +128,13 @@ impl<'a: 'b, 'b> Handler<'a> {
.hide_default_value(true)
.env("FFSEND_TRANSFER_TIMEOUT")
.hide_env_values(true)
.validator(|arg| arg
.parse::<u64>()
.map(|_| ())
.map_err(|_| String::from(
"Timeout time must be a positive number of seconds, or 0 to disable."
))
),
.validator(|arg| {
parse_duration(&arg).map(drop).map_err(|_| {
String::from(
"Timeout time must be a positive number of seconds, or 0 to disable."
)
})
}),
)
.arg(
Arg::with_name("quiet")
@ -142,10 +152,12 @@ impl<'a: 'b, 'b> Handler<'a> {
.help("Enable verbose information and logging"),
)
.arg(ArgApi::build())
.arg(ArgBasicAuth::build())
.subcommand(CmdDebug::build())
.subcommand(CmdDelete::build())
.subcommand(CmdDownload::build().display_order(2))
.subcommand(CmdExists::build())
.subcommand(CmdGenerate::build())
.subcommand(CmdInfo::build())
.subcommand(CmdParams::build())
.subcommand(CmdPassword::build())
@ -188,9 +200,40 @@ impl<'a: 'b, 'b> Handler<'a> {
/// Parse CLI arguments.
pub fn parse() -> Handler<'a> {
// Obtain the program arguments
#[allow(unused_mut)]
let mut args: Vec<_> = ::std::env::args_os().collect();
// Infer subcommand based on binary name
#[cfg(feature = "infer-command")]
Self::infer_subcommand(&mut args);
// Build the application CLI definition, get the matches
Handler {
matches: Handler::build().get_matches(),
matches: Handler::build().get_matches_from(args),
}
}
/// Infer subcommand when the binary has a predefined name,
/// modifying the given program arguments.
///
/// If no subcommand could be inferred, the `args` list leaves unchanged.
/// See `crate::config::INFER_COMMANDS` for a list of commands.
///
/// When the `ffsend` binary is called with such a name, the corresponding subcommand is
/// automatically inserted as argument. This also works when calling binaries through symbolic
/// or hard links.
#[cfg(feature = "infer-command")]
fn infer_subcommand(args: &mut Vec<OsString>) {
// Get the name of the called binary
let name = bin_name();
// Infer subcommands
for (bin, subcmd) in INFER_COMMANDS.iter() {
if &name == bin {
args.insert(1, subcmd.into());
break;
}
}
}
@ -219,6 +262,11 @@ impl<'a: 'b, 'b> Handler<'a> {
ExistsMatcher::with(&self.matches)
}
/// Get the generate sub command, if matched.
pub fn generate(&'a self) -> Option<GenerateMatcher> {
GenerateMatcher::with(&self.matches)
}
/// Get the history sub command, if matched.
#[cfg(feature = "history")]
pub fn history(&'a self) -> Option<HistoryMatcher> {

View file

@ -26,8 +26,8 @@ impl<'a: 'b, 'b> DownloadMatcher<'a> {
/// Guess the file share host, based on the file share URL.
///
/// See `Self::url`.
pub fn guess_host(&'a self) -> Url {
let mut url = self.url();
pub fn guess_host(&'a self, url: Option<Url>) -> Url {
let mut url = url.unwrap_or(self.url());
url.set_path("");
url.set_query(None);
url.set_fragment(None);

View file

@ -0,0 +1,64 @@
use std::path::PathBuf;
use std::str::FromStr;
use clap::{ArgMatches, Shell};
use super::Matcher;
/// The completions completions command matcher.
pub struct CompletionsMatcher<'a> {
matches: &'a ArgMatches<'a>,
}
impl<'a: 'b, 'b> CompletionsMatcher<'a> {
/// Get the shells to generate completions for.
pub fn shells(&'a self) -> Vec<Shell> {
// Get the raw list of shells
let raw = self
.matches
.values_of("SHELL")
.expect("no shells were given");
// Parse the list of shell names, deduplicate
let mut shells: Vec<_> = raw
.into_iter()
.map(|name| name.trim().to_lowercase())
.map(|name| {
if name == "all" {
Shell::variants()
.iter()
.map(|name| name.to_string())
.collect()
} else {
vec![name]
}
})
.flatten()
.collect();
shells.sort_unstable();
shells.dedup();
// Parse the shell names
shells
.into_iter()
.map(|name| Shell::from_str(&name).expect("failed to parse shell name"))
.collect()
}
/// The target directory to output the shell completion files to.
pub fn output(&'a self) -> PathBuf {
self.matches
.value_of("output")
.map(PathBuf::from)
.unwrap_or_else(|| PathBuf::from("./"))
}
}
impl<'a> Matcher<'a> for CompletionsMatcher<'a> {
fn with(matches: &'a ArgMatches) -> Option<Self> {
matches
.subcommand_matches("generate")?
.subcommand_matches("completions")
.map(|matches| CompletionsMatcher { matches })
}
}

View file

@ -0,0 +1,29 @@
pub mod completions;
use clap::ArgMatches;
use super::Matcher;
use completions::CompletionsMatcher;
/// The generate command matcher.
pub struct GenerateMatcher<'a> {
root: &'a ArgMatches<'a>,
_matches: &'a ArgMatches<'a>,
}
impl<'a: 'b, 'b> GenerateMatcher<'a> {
/// Get the generate completions sub command, if matched.
pub fn matcher_completions(&'a self) -> Option<CompletionsMatcher> {
CompletionsMatcher::with(&self.root)
}
}
impl<'a> Matcher<'a> for GenerateMatcher<'a> {
fn with(root: &'a ArgMatches) -> Option<Self> {
root.subcommand_matches("generate")
.map(|matches| GenerateMatcher {
root,
_matches: matches,
})
}
}

View file

@ -1,6 +1,10 @@
use clap::ArgMatches;
use failure::Fail;
use ffsend_api::url::Url;
use super::Matcher;
use crate::host::parse_host;
use crate::util::{quit_error, ErrorHints};
/// The history command matcher.
pub struct HistoryMatcher<'a> {
@ -8,6 +12,32 @@ pub struct HistoryMatcher<'a> {
matches: &'a ArgMatches<'a>,
}
impl<'a> HistoryMatcher<'a> {
/// Check whether to clear all history.
pub fn clear(&self) -> bool {
self.matches.is_present("clear")
}
/// Check whether to remove a given entry from the history.
///
/// This method parses the URL into an `Url`.
/// If the given URL is invalid,
/// the program will quit with an error message.
pub fn rm(&'a self) -> Option<Url> {
// Get the URL
let url = self.matches.value_of("rm")?;
// Parse the URL
match parse_host(&url) {
Ok(url) => Some(url),
Err(err) => quit_error(
err.context("failed to parse the given share URL"),
ErrorHints::default(),
),
}
}
}
impl<'a> Matcher<'a> for HistoryMatcher<'a> {
fn with(matches: &'a ArgMatches) -> Option<Self> {
matches

View file

@ -5,8 +5,8 @@ use clap::ArgMatches;
use ffsend_api::api::DesiredVersion;
use super::Matcher;
use crate::cmd::arg::{ArgApi, CmdArgOption};
use crate::util::env_var_present;
use crate::cmd::arg::{ArgApi, ArgBasicAuth, CmdArgOption};
use crate::util::{env_var_present, parse_duration};
#[cfg(feature = "history")]
use crate::util::{quit_error_msg, ErrorHintsBuilder};
@ -36,6 +36,11 @@ impl<'a: 'b, 'b> MainMatcher<'a> {
ArgApi::value(self.matches)
}
/// Get basic HTTP authentication credentials to use.
pub fn basic_auth(&'a self) -> Option<(String, Option<String>)> {
ArgBasicAuth::value(self.matches)
}
/// Get the history file to use.
#[cfg(feature = "history")]
pub fn history(&self) -> PathBuf {
@ -60,16 +65,16 @@ impl<'a: 'b, 'b> MainMatcher<'a> {
pub fn timeout(&self) -> u64 {
self.matches
.value_of("timeout")
.and_then(|arg| arg.parse().ok())
.expect("invalid timeout value")
.and_then(|arg| parse_duration(arg).ok())
.expect("invalid timeout value") as u64
}
/// Get the transfer timeout in seconds
pub fn transfer_timeout(&self) -> u64 {
self.matches
.value_of("transfer-timeout")
.and_then(|arg| arg.parse().ok())
.expect("invalid transfer-timeout value")
.and_then(|arg| parse_duration(arg).ok())
.expect("invalid transfer-timeout value") as u64
}
/// Check whether we are incognito from the file history.

View file

@ -2,6 +2,7 @@ pub mod debug;
pub mod delete;
pub mod download;
pub mod exists;
pub mod generate;
#[cfg(feature = "history")]
pub mod history;
pub mod info;
@ -16,6 +17,7 @@ pub use self::debug::DebugMatcher;
pub use self::delete::DeleteMatcher;
pub use self::download::DownloadMatcher;
pub use self::exists::ExistsMatcher;
pub use self::generate::GenerateMatcher;
#[cfg(feature = "history")]
pub use self::history::HistoryMatcher;
pub use self::info::InfoMatcher;

View file

@ -1,8 +1,12 @@
use clap::ArgMatches;
use ffsend_api::api::Version as ApiVersion;
use ffsend_api::url::Url;
use super::Matcher;
use crate::cmd::arg::{ArgDownloadLimit, ArgOwner, ArgUrl, CmdArgOption};
use crate::cmd::{
arg::{ArgDownloadLimit, ArgOwner, ArgUrl, CmdArgOption},
matcher::MainMatcher,
};
/// The params command matcher.
pub struct ParamsMatcher<'a> {
@ -26,8 +30,16 @@ impl<'a: 'b, 'b> ParamsMatcher<'a> {
}
/// Get the download limit.
pub fn download_limit(&'a self) -> Option<u8> {
ArgDownloadLimit::value(self.matches)
///
/// If the download limit was the default, `None` is returned to not
/// explicitly set it.
pub fn download_limit(
&'a self,
main_matcher: &MainMatcher,
api_version: ApiVersion,
auth: bool,
) -> Option<usize> {
ArgDownloadLimit::value_checked(self.matches, main_matcher, api_version, auth)
}
}

View file

@ -1,10 +1,13 @@
use clap::ArgMatches;
use ffsend_api::action::params::PARAMS_DEFAULT_DOWNLOAD as DOWNLOAD_DEFAULT;
use ffsend_api::url::Url;
use ffsend_api::{api::Version as ApiVersion, config, url::Url};
use super::Matcher;
use crate::cmd::arg::{
ArgDownloadLimit, ArgGenPassphrase, ArgHost, ArgPassword, CmdArgFlag, CmdArgOption,
use crate::cmd::{
arg::{
ArgDownloadLimit, ArgExpiryTime, ArgGenPassphrase, ArgHost, ArgPassword, CmdArgFlag,
CmdArgOption,
},
matcher::MainMatcher,
};
use crate::util::{bin_name, env_var_present, quit_error_msg, ErrorHintsBuilder};
@ -16,10 +19,11 @@ pub struct UploadMatcher<'a> {
impl<'a: 'b, 'b> UploadMatcher<'a> {
/// Get the selected file to upload.
// TODO: maybe return a file or path instance here
pub fn file(&'a self) -> &'a str {
pub fn files(&'a self) -> Vec<&'a str> {
self.matches
.value_of("FILE")
.values_of("FILE")
.expect("no file specified to upload")
.collect()
}
/// The the name to use for the uploaded file.
@ -31,7 +35,7 @@ impl<'a: 'b, 'b> UploadMatcher<'a> {
let name = self.matches.value_of("name")?;
// The file name must not be empty
// TODO: allow to force an empty name here, and process emtpy names on downloading
// TODO: allow to force an empty name here, and process empty names on downloading
if name.trim().is_empty() {
quit_error_msg(
"the file name must not be empty",
@ -73,13 +77,33 @@ impl<'a: 'b, 'b> UploadMatcher<'a> {
}
/// Get the download limit.
///
/// If the download limit was the default, `None` is returned to not
/// explicitly set it.
pub fn download_limit(&'a self) -> Option<u8> {
ArgDownloadLimit::value(self.matches).and_then(|d| match d {
DOWNLOAD_DEFAULT => None,
d => Some(d),
})
pub fn download_limit(
&'a self,
main_matcher: &MainMatcher,
api_version: ApiVersion,
auth: bool,
) -> Option<usize> {
ArgDownloadLimit::value_checked(self.matches, main_matcher, api_version, auth).and_then(
|d| match d {
d if d == config::downloads_default(api_version, auth) => None,
d => Some(d),
},
)
}
/// Get the expiry time in seconds.
///
/// If the expiry time was not set, `None` is returned.
pub fn expiry_time(
&'a self,
main_matcher: &MainMatcher,
api_version: ApiVersion,
auth: bool,
) -> Option<usize> {
ArgExpiryTime::value_checked(self.matches, main_matcher, api_version, auth)
}
/// Check whether to archive the file to upload.
@ -93,6 +117,11 @@ impl<'a: 'b, 'b> UploadMatcher<'a> {
self.matches.is_present("open") || env_var_present("FFSEND_OPEN")
}
/// Check whether to to delete local files after uploading.
pub fn delete(&self) -> bool {
self.matches.is_present("delete")
}
/// Check whether to copy the file URL in the user's clipboard, get the copy mode.
#[cfg(feature = "clipboard")]
pub fn copy(&self) -> Option<CopyMode> {
@ -109,6 +138,18 @@ impl<'a: 'b, 'b> UploadMatcher<'a> {
None
}
}
/// Check whether to shorten a share URL
#[cfg(feature = "urlshorten")]
pub fn shorten(&self) -> bool {
self.matches.is_present("shorten")
}
/// Check whether to print a QR code for the share URL.
#[cfg(feature = "qrcode")]
pub fn qrcode(&self) -> bool {
self.matches.is_present("qrcode")
}
}
impl<'a> Matcher<'a> for UploadMatcher<'a> {
@ -130,7 +171,7 @@ pub enum CopyMode {
}
impl CopyMode {
/// Build the string to copy, based on the given `url` and currend mode.
/// Build the string to copy, based on the given `url` and current mode.
pub fn build(&self, url: &str) -> String {
match self {
CopyMode::Url => url.into(),

View file

@ -10,6 +10,7 @@ impl CmdDelete {
SubCommand::with_name("delete")
.about("Delete a shared file")
.visible_alias("del")
.visible_alias("rm")
.arg(ArgUrl::build())
.arg(ArgOwner::build())
}

View file

@ -23,7 +23,7 @@ impl CmdDownload {
.alias("out")
.alias("file")
.value_name("PATH")
.help("The output file or directory"),
.help("Output file or directory"),
);
// Optional archive support

View file

@ -0,0 +1,33 @@
use clap::{App, Arg, Shell, SubCommand};
/// The generate completions command definition.
pub struct CmdCompletions;
impl CmdCompletions {
pub fn build<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("completions")
.about("Shell completions")
.alias("completion")
.alias("complete")
.arg(
Arg::with_name("SHELL")
.help("Shell type to generate completions for")
.required(true)
.multiple(true)
.takes_value(true)
.possible_value("all")
.possible_values(&Shell::variants())
.case_insensitive(true),
)
.arg(
Arg::with_name("output")
.long("output")
.short("o")
.alias("output-dir")
.alias("out")
.alias("dir")
.value_name("DIR")
.help("Shell completion files output directory"),
)
}
}

View file

@ -0,0 +1,18 @@
pub mod completions;
use clap::{App, AppSettings, SubCommand};
use completions::CmdCompletions;
/// The generate command definition.
pub struct CmdGenerate;
impl CmdGenerate {
pub fn build<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("generate")
.about("Generate assets")
.visible_alias("gen")
.setting(AppSettings::SubcommandRequiredElseHelp)
.subcommand(CmdCompletions::build())
}
}

View file

@ -1,4 +1,4 @@
use clap::{App, SubCommand};
use clap::{App, Arg, SubCommand};
/// The history command definition.
pub struct CmdHistory;
@ -9,5 +9,20 @@ impl CmdHistory {
.about("View file history")
.visible_alias("h")
.alias("ls")
.arg(
Arg::with_name("rm")
.long("rm")
.short("R")
.alias("remove")
.value_name("URL")
.help("Remove history entry"),
)
.arg(
Arg::with_name("clear")
.long("clear")
.short("C")
.alias("flush")
.help("Clear all history"),
)
}
}

View file

@ -2,6 +2,7 @@ pub mod debug;
pub mod delete;
pub mod download;
pub mod exists;
pub mod generate;
#[cfg(feature = "history")]
pub mod history;
pub mod info;
@ -15,6 +16,7 @@ pub use self::debug::CmdDebug;
pub use self::delete::CmdDelete;
pub use self::download::CmdDownload;
pub use self::exists::CmdExists;
pub use self::generate::CmdGenerate;
#[cfg(feature = "history")]
pub use self::history::CmdHistory;
pub use self::info::CmdInfo;

View file

@ -1,7 +1,8 @@
use clap::{App, Arg, SubCommand};
use ffsend_api::action::params::PARAMS_DEFAULT_DOWNLOAD_STR as DOWNLOAD_DEFAULT;
use crate::cmd::arg::{ArgDownloadLimit, ArgGenPassphrase, ArgHost, ArgPassword, CmdArg};
use crate::cmd::arg::{
ArgDownloadLimit, ArgExpiryTime, ArgGenPassphrase, ArgHost, ArgPassword, CmdArg,
};
/// The upload command definition.
pub struct CmdUpload;
@ -16,13 +17,14 @@ impl CmdUpload {
.visible_alias("up")
.arg(
Arg::with_name("FILE")
.help("The file to upload")
.help("The file(s) to upload")
.required(true)
.multiple(false),
.multiple(true),
)
.arg(ArgPassword::build().help("Protect the file with a password"))
.arg(ArgGenPassphrase::build())
.arg(ArgDownloadLimit::build().default_value(DOWNLOAD_DEFAULT))
.arg(ArgDownloadLimit::build())
.arg(ArgExpiryTime::build())
.arg(ArgHost::build())
.arg(
Arg::with_name("name")
@ -38,6 +40,13 @@ impl CmdUpload {
.long("open")
.short("o")
.help("Open the share link in your browser"),
)
.arg(
Arg::with_name("delete")
.long("delete")
.alias("rm")
.short("D")
.help("Delete local file after upload"),
);
// Optional archive support
@ -73,6 +82,31 @@ impl CmdUpload {
);
}
// Optional url shortening support
#[cfg(feature = "urlshorten")]
{
cmd = cmd.arg(
Arg::with_name("shorten")
.long("shorten")
.alias("short")
.alias("url-shorten")
.short("S")
.help("Shorten share URLs with a public service"),
)
}
// Optional qrcode support
#[cfg(feature = "qrcode")]
{
cmd = cmd.arg(
Arg::with_name("qrcode")
.long("qrcode")
.alias("qr")
.short("Q")
.help("Print a QR code for the share URL"),
)
}
cmd
}
}

View file

@ -1,3 +1,6 @@
#[cfg(feature = "infer-command")]
use std::collections::HashMap;
use ffsend_api::api::{DesiredVersion, Version};
/// The timeout for the Send client for generic requests, `0` to disable.
@ -15,3 +18,19 @@ pub const API_VERSION_DESIRED_DEFAULT: DesiredVersion = DesiredVersion::Assume(A
pub const API_VERSION_ASSUME: Version = Version::V3;
#[cfg(not(feature = "send3"))]
pub const API_VERSION_ASSUME: Version = Version::V2;
#[cfg(feature = "infer-command")]
lazy_static! {
/// Hashmap holding binary names to infer subcommands for.
///
/// When the `ffsend` binary is called with such a name, the corresponding subcommand is
/// automatically inserted as argument. This also works when calling binaries through symbolic
/// or hard links.
pub static ref INFER_COMMANDS: HashMap<&'static str, &'static str> = {
let mut m = HashMap::new();
m.insert("ffput", "upload");
m.insert("ffget", "download");
m.insert("ffdel", "delete");
m
};
}

View file

@ -6,6 +6,7 @@ use ffsend_api::action::version::Error as VersionError;
use ffsend_api::file::remote_file::FileParseError;
use crate::action::download::Error as CliDownloadError;
use crate::action::generate::completions::Error as CliGenerateCompletionsError;
#[cfg(feature = "history")]
use crate::action::history::Error as CliHistoryError;
use crate::action::info::Error as CliInfoError;
@ -56,6 +57,10 @@ pub enum ActionError {
#[fail(display = "failed to check whether the file exists")]
Exists(#[cause] ExistsError),
/// An error occurred while generating completions.
#[fail(display = "failed to generate shell completions")]
GenerateCompletions(#[cause] CliGenerateCompletionsError),
/// An error occurred while processing the file history.
#[cfg(feature = "history")]
#[fail(display = "failed to process the history")]
@ -99,6 +104,12 @@ impl From<ExistsError> for ActionError {
}
}
impl From<CliGenerateCompletionsError> for ActionError {
fn from(err: CliGenerateCompletionsError) -> ActionError {
ActionError::GenerateCompletions(err)
}
}
#[cfg(feature = "history")]
impl From<CliHistoryError> for ActionError {
fn from(err: CliHistoryError) -> ActionError {

View file

@ -1,15 +1,14 @@
extern crate toml;
extern crate version_compare;
use std::fs;
use std::io::Error as IoError;
use std::path::PathBuf;
use self::toml::de::Error as DeError;
use self::toml::ser::Error as SerError;
use self::version_compare::{CompOp, VersionCompare};
use failure::Fail;
use ffsend_api::file::remote_file::RemoteFile;
use ffsend_api::{
file::remote_file::{FileParseError, RemoteFile},
url::Url,
};
use toml::{de::Error as DeError, ser::Error as SerError};
use version_compare::Cmp;
use crate::util::{print_error, print_warning};
@ -22,7 +21,7 @@ const VERSION_MAX: &str = crate_version!();
#[derive(Serialize, Deserialize)]
pub struct History {
/// The application version the history file was built with.
/// Used for compatability checking.
/// Used for compatibility checking.
version: Option<String>,
/// The file history.
@ -63,9 +62,9 @@ impl History {
// Get the version number from the file
let version = history.version.as_ref().unwrap();
if let Ok(true) = VersionCompare::compare_to(version, VERSION_MIN, &CompOp::Lt) {
if let Ok(true) = version_compare::compare_to(version, VERSION_MIN, Cmp::Lt) {
print_warning("history file version is too old, ignoring");
} else if let Ok(true) = VersionCompare::compare_to(version, VERSION_MAX, &CompOp::Gt) {
} else if let Ok(true) = version_compare::compare_to(version, VERSION_MAX, Cmp::Gt) {
print_warning("history file has an unknown version, ignoring");
}
}
@ -104,11 +103,26 @@ impl History {
return Ok(());
}
// Ensure the file parnet directories are available
// Ensure the file parent directories are available
if let Some(parent) = path.parent() {
fs::create_dir_all(parent)?;
}
// Set file permissions on unix based systems
#[cfg(unix)]
{
use std::fs::Permissions;
use std::os::unix::fs::PermissionsExt;
if !path.exists() {
let file = fs::File::create(path).map_err(SaveError::Write)?;
// Set Read/Write permissions for the user
file.set_permissions(Permissions::from_mode(0o600))
.map_err(SaveError::SetPermissions)?;
}
}
// Build the data and write to a file
let data = toml::to_string(self)?;
fs::write(&path, data)?;
@ -152,16 +166,16 @@ impl History {
self.changed = true;
}
/// Remove the given remote file, matched by it's file ID.
/// Remove a file, matched by it's file ID.
///
/// If any file was removed, true is returned.
pub fn remove(&mut self, file: &RemoteFile) -> bool {
pub fn remove(&mut self, id: &str) -> bool {
// Get the indices of files that have expired
let expired_indices: Vec<usize> = self
.files
.iter()
.enumerate()
.filter(|&(_, f)| f.id() == file.id())
.filter(|&(_, f)| f.id() == id)
.map(|(i, _)| i)
.collect();
@ -177,6 +191,13 @@ impl History {
!expired_indices.is_empty()
}
/// Remove a file by the given URL.
///
/// If any file was removed, true is returned.
pub fn remove_url(&mut self, url: Url) -> Result<bool, FileParseError> {
Ok(self.remove(RemoteFile::parse_url(url, None)?.id()))
}
/// Get all files.
pub fn files(&self) -> &Vec<RemoteFile> {
&self.files
@ -192,12 +213,18 @@ impl History {
.find(|f| f.id() == file.id() && f.host() == file.host())
}
/// Clear all history.
pub fn clear(&mut self) {
self.changed = !self.files.is_empty();
self.files.clear();
}
/// Garbage collect (remove) all files that have been expired,
/// as defined by their `expire_at` property.
///
/// If the expiry property is None (thus unknown), the file will be kept.
///
/// The number of exired files is returned.
/// The number of expired files is returned.
pub fn gc(&mut self) -> usize {
// Get a list of expired files
let expired: Vec<RemoteFile> = self
@ -209,7 +236,7 @@ impl History {
// Remove the files
for f in &expired {
self.remove(f);
self.remove(f.id());
}
// Set the changed flag
@ -305,6 +332,10 @@ pub enum SaveError {
#[fail(display = "failed to write to the history file")]
Write(#[cause] IoError),
/// Failed to set file permissions to the history file.
#[fail(display = "failed to set permissions to the history file")]
SetPermissions(#[cause] IoError),
/// Failed to delete the history file, which was tried because there
/// are no history items to save.
#[fail(display = "failed to delete history file, because history is empty")]

View file

@ -55,7 +55,7 @@ fn remove_error(matcher_main: &MainMatcher, file: &RemoteFile) -> Result<bool, H
// Load the history, remove the file, and save
let mut history = History::load_or_new(matcher_main.history())?;
let removed = history.remove(file);
let removed = history.remove(file.id());
history.save()?;
Ok(removed)
}

View file

@ -23,12 +23,17 @@ mod history;
mod history_tool;
mod host;
mod progress;
#[cfg(feature = "urlshorten")]
mod urlshorten;
mod util;
use std::process;
use crate::action::debug::Debug;
use crate::action::delete::Delete;
use crate::action::download::Download;
use crate::action::exists::Exists;
use crate::action::generate::Generate;
#[cfg(feature = "history")]
use crate::action::history::History;
use crate::action::info::Info;
@ -90,6 +95,13 @@ fn invoke_action(handler: &Handler) -> Result<(), Error> {
.map_err(|err| err.into());
}
// Match the generate command
if handler.generate().is_some() {
return Generate::new(handler.matches())
.invoke()
.map_err(|err| err.into());
}
// Match the history command
#[cfg(feature = "history")]
{
@ -146,7 +158,7 @@ fn invoke_action(handler: &Handler) -> Result<(), Error> {
}
/// Print the main info, shown when no subcommands were supplied.
pub fn print_main_info() {
pub fn print_main_info() -> ! {
// Get the name of the used executable
let bin = bin_name();
@ -162,4 +174,9 @@ pub fn print_main_info() {
println!();
println!("To show all subcommands, features and other help:");
println!(" {}", highlight(&format!("{} help [SUBCOMMAND]", bin)));
println!();
println!("The default public Send host is provided by Tim Visee.");
println!("Please consider to donate and help keep it running: https://vis.ee/donate");
process::exit(1)
}

View file

@ -1,10 +1,8 @@
extern crate pbr;
use std::io::{stderr, Stderr};
use std::time::Duration;
use self::pbr::{ProgressBar as Pbr, Units};
use ffsend_api::pipe::ProgressReporter;
use pbr::{ProgressBar as Pbr, Units};
/// The refresh rate of the progress bar, in milliseconds.
const PROGRESS_BAR_FPS_MILLIS: u64 = 200;
@ -59,9 +57,17 @@ impl<'a> ProgressReporter for ProgressBar<'a> {
/// Finish the progress.
fn finish(&mut self) {
self.progress_bar
let progress_bar = self
.progress_bar
.as_mut()
.expect("progress bar not yet instantiated")
.finish_print(self.msg_finish);
.expect("progress bar not yet instantiated");
#[cfg(not(target_os = "windows"))]
progress_bar.finish_print(self.msg_finish);
#[cfg(target_os = "windows")]
{
progress_bar.finish_println(self.msg_finish);
eprintln!();
}
}
}

98
src/urlshorten.rs Normal file
View file

@ -0,0 +1,98 @@
//! URL shortening mechanics.
use ffsend_api::{
api::request::{ensure_success, ResponseError},
client::Client,
reqwest,
url::{self, Url},
};
use urlshortener::{
providers::{self, Provider},
request::{Method, Request},
};
/// An URL shortening result.
type Result<T> = ::std::result::Result<T, Error>;
/// Shorten the given URL.
pub fn shorten(client: &Client, url: &str) -> Result<String> {
// TODO: allow selecting other shorteners
request(client, providers::request(url, &Provider::IsGd))
}
/// Shorten the given URL.
pub fn shorten_url(client: &Client, url: &Url) -> Result<Url> {
Url::parse(&shorten(client, url.as_str())?).map_err(|err| err.into())
}
/// Do the request as given, return the response.
fn request(client: &Client, req: Request) -> Result<String> {
// Start the request builder
let mut builder = match req.method {
Method::Get => client.get(&req.url),
Method::Post => client.post(&req.url),
};
// Define the custom user agent
if let Some(_agent) = req.user_agent.clone() {
// TODO: implement this
// builder.header(header::UserAgent::new(agent.0));
panic!("Custom UserAgent for URL shortener not yet implemented");
}
// Define the custom content type
if let Some(_content_type) = req.content_type {
// TODO: implement this
// match content_type {
// ContentType::Json => builder.header(header::ContentType::json()),
// ContentType::FormUrlEncoded => {
// builder.header(header::ContentType::form_url_encoded())
// }
// };
panic!("Custom UserAgent for URL shortener not yet implemented");
}
// Define the custom body
if let Some(body) = req.body.clone() {
builder = builder.body(body);
}
// Send the request, ensure success
let response = builder.send().map_err(Error::Request)?;
ensure_success(&response)?;
// Respond with the body text
response.text().map_err(Error::Malformed)
}
/// An URL shortening error.
#[derive(Debug, Fail)]
pub enum Error {
/// Failed to send the shortening request.
#[fail(display = "failed to send URL shorten request")]
Request(#[cause] reqwest::Error),
/// The server responded with a bad response.
#[fail(display = "failed to shorten URL, got bad response")]
Response(#[cause] ResponseError),
/// The server responded with a malformed response.
#[fail(display = "failed to shorten URL, got malformed response")]
Malformed(#[cause] reqwest::Error),
/// An error occurred while parsing the shortened URL.
#[fail(display = "failed to shorten URL, could not parse URL")]
Url(#[cause] url::ParseError),
}
impl From<url::ParseError> for Error {
fn from(err: url::ParseError) -> Self {
Error::Url(err)
}
}
impl From<ResponseError> for Error {
fn from(err: ResponseError) -> Self {
Error::Response(err)
}
}

View file

@ -1,36 +1,47 @@
#[cfg(all(feature = "clipboard", not(target_os = "linux")))]
extern crate clipboard;
extern crate colored;
extern crate directories;
extern crate fs2;
extern crate open;
#[cfg(feature = "clipboard-crate")]
extern crate clip;
#[cfg(feature = "clipboard-bin")]
extern crate which;
use std::borrow::Borrow;
use std::env::{current_exe, var_os};
use std::env::{self, current_exe, var_os};
use std::ffi::OsStr;
use std::fmt::{Debug, Display};
#[cfg(feature = "clipboard")]
use std::fmt;
use std::fmt::{Debug, Display};
#[cfg(feature = "clipboard-bin")]
use std::io::ErrorKind as IoErrorKind;
use std::io::{self, Read};
use std::io::{stderr, stdin, Error as IoError, Write};
use std::iter;
use std::path::Path;
#[cfg(feature = "history")]
use std::path::PathBuf;
use std::process::{exit, ExitStatus};
#[cfg(all(feature = "clipboard", target_os = "linux"))]
use std::process::exit;
#[cfg(feature = "clipboard-bin")]
use std::process::{Command, Stdio};
#[cfg(all(feature = "clipboard", not(target_os = "linux")))]
use self::clipboard::{ClipboardContext, ClipboardProvider};
use self::colored::*;
#[cfg(feature = "history")]
use self::directories::ProjectDirs;
use self::fs2::available_space;
#[cfg(feature = "clipboard-crate")]
use self::clip::{ClipboardContext, ClipboardProvider};
use chrono::Duration;
use colored::*;
#[cfg(feature = "history")]
use directories::ProjectDirs;
use failure::{err_msg, Fail};
#[cfg(all(feature = "clipboard", not(target_os = "linux")))]
#[cfg(feature = "clipboard-crate")]
use failure::{Compat, Error};
use ffsend_api::url::Url;
use ffsend_api::{
api::request::{ensure_success, ResponseError},
client::Client,
reqwest,
url::Url,
};
use fs2::available_space;
use rand::distributions::Alphanumeric;
use rand::{thread_rng, Rng};
use regex::Regex;
use rpassword::prompt_password_stderr;
#[cfg(feature = "clipboard-bin")]
use which::which;
use crate::cmd::matcher::MainMatcher;
@ -122,6 +133,9 @@ pub struct ErrorHints {
/// A list of info messages to print along with the error.
info: Vec<String>,
/// Show about the name option.
name: bool,
/// Show about the password option.
password: bool,
@ -147,7 +161,8 @@ impl ErrorHints {
pub fn any(&self) -> bool {
// Determine the result
#[allow(unused_mut)]
let mut result = self.password || self.owner || self.force || self.verbose || self.help;
let mut result =
self.name || self.password || self.owner || self.force || self.verbose || self.help;
// Factor in the history hint when enabled
#[cfg(feature = "history")]
@ -179,6 +194,12 @@ impl ErrorHints {
highlight("--api <VERSION>")
);
}
if self.name {
eprintln!(
"Use '{}' to specify a file name",
highlight("--name <NAME>")
);
}
if self.password {
eprintln!(
"Use '{}' to specify a password",
@ -220,6 +241,7 @@ impl Default for ErrorHints {
ErrorHints {
api: false,
info: Vec::new(),
name: false,
password: false,
owner: false,
#[cfg(feature = "history")]
@ -269,42 +291,137 @@ pub fn highlight_info(msg: &str) -> ColoredString {
}
/// Open the given URL in the users default browser.
/// The browsers exit statis is returned.
pub fn open_url(url: impl Borrow<Url>) -> Result<ExitStatus, IoError> {
/// The browsers exit status is returned.
pub fn open_url(url: impl Borrow<Url>) -> Result<(), IoError> {
open_path(url.borrow().as_str())
}
/// Open the given path or URL using the program configured on the system.
/// The program exit statis is returned.
pub fn open_path(path: &str) -> Result<ExitStatus, IoError> {
/// The program exit status is returned.
pub fn open_path(path: &str) -> Result<(), IoError> {
open::that(path)
}
/// Set the clipboard of the user to the given `content` string.
#[cfg(feature = "clipboard")]
pub fn set_clipboard(content: String) -> Result<(), ClipboardError> {
#[cfg(not(target_os = "linux"))]
{
ClipboardType::select().set(content)
}
/// Clipboard management enum.
///
/// Defines which method of setting the clipboard is used.
/// Invoke `ClipboardType::select()` to select the best variant to use determined at runtime.
///
/// Usually, the `Native` variant is used. However, on Linux system a different variant will be
/// selected which will call a system binary to set the clipboard. This must be done because the
/// native clipboard interface only has a lifetime of the application. This means that the
/// clipboard is instantly cleared as soon as this application quits, which is always immediately.
/// This limitation is due to security reasons as defined by X11. The alternative binaries we set
/// the clipboard with spawn a daemon in the background to keep the clipboard alive until it's
/// flushed.
#[cfg(feature = "clipboard")]
#[derive(Clone, Eq, PartialEq)]
pub enum ClipboardType {
/// Native operating system clipboard.
#[cfg(feature = "clipboard-crate")]
Native,
/// Manage clipboard through `xclip` on Linux.
///
/// May contain a binary path if specified at compile time through the `XCLIP_PATH` variable.
#[cfg(feature = "clipboard-bin")]
Xclip(Option<String>),
/// Manage clipboard through `xsel` on Linux.
///
/// May contain a binary path if specified at compile time through the `XSEL_PATH` variable.
#[cfg(feature = "clipboard-bin")]
Xsel(Option<String>),
}
#[cfg(feature = "clipboard")]
impl ClipboardType {
/// Select the clipboard type to use, depending on the runtime system.
pub fn select() -> Self {
#[cfg(feature = "clipboard-crate")]
{
ClipboardType::Native
}
#[cfg(feature = "clipboard-bin")]
{
if let Some(path) = option_env!("XCLIP_PATH") {
ClipboardType::Xclip(Some(path.to_owned()))
} else if let Some(path) = option_env!("XSEL_PATH") {
ClipboardType::Xsel(Some(path.to_owned()))
} else if which("xclip").is_ok() {
ClipboardType::Xclip(None)
} else if which("xsel").is_ok() {
ClipboardType::Xsel(None)
} else {
// TODO: should we error here instead, as no clipboard binary was found?
ClipboardType::Xclip(None)
}
}
}
/// Set clipboard contents through the selected clipboard type.
pub fn set(&self, content: String) -> Result<(), ClipboardError> {
match self {
#[cfg(feature = "clipboard-crate")]
ClipboardType::Native => Self::native_set(content),
#[cfg(feature = "clipboard-bin")]
ClipboardType::Xclip(path) => Self::xclip_set(path.clone(), &content),
#[cfg(feature = "clipboard-bin")]
ClipboardType::Xsel(path) => Self::xsel_set(path.clone(), &content),
}
}
/// Set the clipboard through a native interface.
///
/// This is used on non-Linux systems.
#[cfg(feature = "clipboard-crate")]
fn native_set(content: String) -> Result<(), ClipboardError> {
ClipboardProvider::new()
.and_then(|mut context: ClipboardContext| context.set_contents(content))
.map_err(|err| format_err!("{}", err).compat())
.map_err(ClipboardError::Generic)
.map_err(ClipboardError::Native)
}
#[cfg(target_os = "linux")]
{
// Open an xclip process
let mut process = match Command::new("xclip")
.arg("-sel")
.arg("clip")
.stdin(Stdio::piped())
.spawn()
{
#[cfg(feature = "clipboard-bin")]
fn xclip_set(path: Option<String>, content: &str) -> Result<(), ClipboardError> {
Self::sys_cmd_set(
"xclip",
Command::new(path.unwrap_or_else(|| "xclip".into()))
.arg("-sel")
.arg("clip"),
content,
)
}
#[cfg(feature = "clipboard-bin")]
fn xsel_set(path: Option<String>, content: &str) -> Result<(), ClipboardError> {
Self::sys_cmd_set(
"xsel",
Command::new(path.unwrap_or_else(|| "xsel".into())).arg("--clipboard"),
content,
)
}
#[cfg(feature = "clipboard-bin")]
fn sys_cmd_set(
bin: &'static str,
command: &mut Command,
content: &str,
) -> Result<(), ClipboardError> {
// Spawn the command process for setting the clipboard
let mut process = match command.stdin(Stdio::piped()).stdout(Stdio::null()).spawn() {
Ok(process) => process,
Err(err) => {
return Err(match err.kind() {
IoErrorKind::NotFound => ClipboardError::NoXclip,
_ => ClipboardError::Xclip(err),
IoErrorKind::NotFound => ClipboardError::NoBinary,
_ => ClipboardError::BinaryIo(bin, err),
});
}
};
@ -315,12 +432,17 @@ pub fn set_clipboard(content: String) -> Result<(), ClipboardError> {
.as_mut()
.unwrap()
.write_all(content.as_bytes())
.map_err(ClipboardError::Xclip)?;
.map_err(|err| ClipboardError::BinaryIo(bin, err))?;
// Wait for xclip to exit
let status = process.wait().map_err(ClipboardError::Xclip)?;
let status = process
.wait()
.map_err(|err| ClipboardError::BinaryIo(bin, err))?;
if !status.success() {
return Err(ClipboardError::XclipStatus(status.code().unwrap_or(0)));
return Err(ClipboardError::BinaryStatus(
bin,
status.code().unwrap_or(0),
));
}
Ok(())
@ -328,36 +450,58 @@ pub fn set_clipboard(content: String) -> Result<(), ClipboardError> {
}
#[cfg(feature = "clipboard")]
#[derive(Debug, Fail)]
pub enum ClipboardError {
/// A generic error occurred while setting the clipboard contents
#[cfg(not(target_os = "linux"))]
#[fail(display = "failed to access clipboard")]
Generic(#[cause] Compat<Error>),
/// Xclip is not installed on the system, which is required for clipboard support.
#[cfg(target_os = "linux")]
#[fail(display = "failed to access clipboard, xclip is not installed")]
NoXclip,
/// An error occurred while using xclip to set the clipboard contents.
/// This problem probably occurred when stargin the xclip process, or while piping the
/// clipboard contents to the process.
#[cfg(target_os = "linux")]
#[fail(display = "failed to access clipboard using xclip")]
Xclip(#[cause] IoError),
/// Xclip unexpectetly exited with a non-successful status code.
#[cfg(target_os = "linux")]
#[fail(
display = "failed to use clipboard, xclip exited with status code {}",
_0
)]
XclipStatus(i32),
impl fmt::Display for ClipboardType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
#[cfg(feature = "clipboard-crate")]
ClipboardType::Native => write!(f, "native"),
#[cfg(feature = "clipboard-bin")]
ClipboardType::Xclip(path) => match path {
None => write!(f, "xclip"),
Some(path) => write!(f, "xclip ({})", path),
},
#[cfg(feature = "clipboard-bin")]
ClipboardType::Xsel(path) => match path {
None => write!(f, "xsel"),
Some(path) => write!(f, "xsel ({})", path),
},
}
}
}
/// Check for an emtpy password in the given `password`.
/// If the password is emtpy the program will quit with an error unless
#[cfg(feature = "clipboard")]
#[derive(Debug, Fail)]
pub enum ClipboardError {
/// A generic error occurred while setting the clipboard contents.
///
/// This is for non-Linux systems, using a native clipboard interface.
#[cfg(feature = "clipboard-crate")]
#[fail(display = "failed to access clipboard")]
Native(#[cause] Compat<Error>),
/// The `xclip` or `xsel` binary could not be found on the system, required for clipboard support.
#[cfg(feature = "clipboard-bin")]
#[fail(display = "failed to access clipboard, xclip or xsel is not installed")]
NoBinary,
/// An error occurred while using `xclip` or `xsel` to set the clipboard contents.
/// This problem probably occurred when starting, or while piping the clipboard contents to
/// the process.
#[cfg(feature = "clipboard-bin")]
#[fail(display = "failed to access clipboard using {}", _0)]
BinaryIo(&'static str, #[cause] IoError),
/// `xclip` or `xsel` unexpectedly exited with a non-successful status code.
#[cfg(feature = "clipboard-bin")]
#[fail(
display = "failed to use clipboard, {} exited with status code {}",
_0, _1
)]
BinaryStatus(&'static str, i32),
}
/// Check for an empty password in the given `password`.
/// If the password is empty the program will quit with an error unless
/// forced.
// TODO: move this to a better module
pub fn check_empty_password(password: &str, matcher_main: &MainMatcher) {
@ -375,7 +519,7 @@ pub fn check_empty_password(password: &str, matcher_main: &MainMatcher) {
/// Prompt the user to enter a password.
///
/// If `empty` is `false`, emtpy passwords aren't allowed unless forced.
/// If `empty` is `false`, empty passwords aren't allowed unless forced.
pub fn prompt_password(main_matcher: &MainMatcher, optional: bool) -> Option<String> {
// Quit with an error if we may not interact
if !optional && main_matcher.no_interact() {
@ -405,7 +549,7 @@ pub fn prompt_password(main_matcher: &MainMatcher, optional: bool) -> Option<Str
}
}
// On input error, propegate the error or don't use a password if optional
// On input error, propagate the error or don't use a password if optional
Err(err) => {
if !optional {
quit_error(
@ -448,7 +592,7 @@ pub fn ensure_password(
return false;
}
// Check whehter we allow interaction
// Check whether we allow interaction
let interact = !main_matcher.no_interact();
loop {
@ -617,7 +761,7 @@ pub fn ensure_owner_token(
main_matcher: &MainMatcher,
optional: bool,
) -> bool {
// Check whehter we allow interaction
// Check whether we allow interaction
let interact = !main_matcher.no_interact();
// Notify that an owner token is required
@ -681,6 +825,69 @@ pub fn format_bytes(bytes: u64) -> String {
}
}
/// Parse the given duration string from human readable format into seconds.
/// This method parses a string of time components to represent the given duration.
///
/// The following time units are used:
/// - `w`: weeks
/// - `d`: days
/// - `h`: hours
/// - `m`: minutes
/// - `s`: seconds
/// The following time strings can be parsed:
/// - `8w6d`
/// - `23h14m`
/// - `9m55s`
/// - `1s1s1s1s1s`
pub fn parse_duration(duration: &str) -> Result<usize, ParseDurationError> {
// Build a regex to grab time parts
let re = Regex::new(r"(?i)([0-9]+)(([a-z]|\s*$))")
.expect("failed to compile duration parsing regex");
// We must find any match
if re.find(duration).is_none() {
return Err(ParseDurationError::Empty);
}
// Parse each time part, sum it's seconds
let mut seconds = 0;
for capture in re.captures_iter(duration) {
// Parse time value and modifier
let number = capture[1]
.parse::<usize>()
.map_err(ParseDurationError::InvalidValue)?;
let modifier = capture[2].trim().to_lowercase();
// Multiply and sum seconds by modifier
seconds += match modifier.as_str() {
"" | "s" => number,
"m" => number * 60,
"h" => number * 60 * 60,
"d" => number * 60 * 60 * 24,
"w" => number * 60 * 60 * 24 * 7,
m => return Err(ParseDurationError::UnknownIdentifier(m.into())),
};
}
Ok(seconds)
}
/// Represents a duration parsing error.
#[derive(Debug, Fail)]
pub enum ParseDurationError {
/// The given duration string did not contain any duration part.
#[fail(display = "given string did not contain any duration part")]
Empty,
/// A numeric value was invalid.
#[fail(display = "duration part has invalid numeric value")]
InvalidValue(std::num::ParseIntError),
/// The given duration string contained an invalid duration modifier.
#[fail(display = "duration part has unknown time identifier '{}'", _0)]
UnknownIdentifier(String),
}
/// Format the given duration in a human readable format.
/// This method builds a string of time components to represent
/// the given duration.
@ -741,9 +948,19 @@ pub fn format_bool(b: bool) -> &'static str {
}
/// Get the name of the executable that was invoked.
///
/// When a symbolic or hard link is used, the name of the link is returned.
///
/// This attempts to obtain the binary name in the following order:
/// - name in first item of program arguments via `std::env::args`
/// - current executable name via `std::env::current_exe`
/// - crate name
pub fn bin_name() -> String {
current_exe()
.ok()
env::args_os()
.next()
.filter(|path| !path.is_empty())
.map(PathBuf::from)
.or_else(|| current_exe().ok())
.and_then(|p| p.file_name().map(|n| n.to_owned()))
.and_then(|n| n.into_string().ok())
.unwrap_or_else(|| crate_name!().into())
@ -767,7 +984,7 @@ pub fn ensure_enough_space<P: AsRef<Path>>(path: P, size: u64) {
}
};
// Return if enough disk space is avaiable
// Return if enough disk space is available
if space >= size {
return;
}
@ -831,14 +1048,28 @@ pub fn features_list() -> Vec<&'static str> {
features.push("archive");
#[cfg(feature = "clipboard")]
features.push("clipboard");
#[cfg(feature = "clipboard-bin")]
features.push("clipboard-bin");
#[cfg(feature = "clipboard-crate")]
features.push("clipboard-crate");
#[cfg(feature = "history")]
features.push("history");
#[cfg(feature = "no-color")]
#[cfg(feature = "qrcode")]
features.push("qrcode");
#[cfg(feature = "urlshorten")]
features.push("urlshorten");
#[cfg(feature = "infer-command")]
features.push("infer-command");
#[cfg(feature = "no-qcolor")]
features.push("no-color");
#[cfg(feature = "send2")]
features.push("send2");
#[cfg(feature = "send3")]
features.push("send3");
#[cfg(feature = "crypto-ring")]
features.push("crypto-ring");
#[cfg(feature = "crypto-openssl")]
features.push("crypto-openssl");
features
}
@ -857,3 +1088,71 @@ pub fn api_version_list() -> Vec<&'static str> {
versions
}
/// Follow redirects on the given URL, and return the final full URL.
///
/// This is used to obtain share URLs from shortened links.
///
// TODO: extract this into module
pub fn follow_url(client: &Client, url: &Url) -> Result<Url, FollowError> {
// Send the request, follow the URL, ensure success
let response = client
.get(url.as_str())
.send()
.map_err(FollowError::Request)?;
ensure_success(&response)?;
// Obtain the final URL
Ok(response.url().clone())
}
/// URL following error.
#[derive(Debug, Fail)]
pub enum FollowError {
/// Failed to send the shortening request.
#[fail(display = "failed to send URL follow request")]
Request(#[cause] reqwest::Error),
/// The server responded with a bad response.
#[fail(display = "failed to shorten URL, got bad response")]
Response(#[cause] ResponseError),
}
impl From<ResponseError> for FollowError {
fn from(err: ResponseError) -> Self {
FollowError::Response(err)
}
}
/// Generate a random alphanumeric string with the given length.
pub fn rand_alphanum_string(len: usize) -> String {
let mut rng = thread_rng();
iter::repeat(())
.map(|()| rng.sample(Alphanumeric) as char)
.take(len)
.collect()
}
/// Read file from stdin.
pub fn stdin_read_file(prompt: bool) -> Result<Vec<u8>, StdinErr> {
if prompt {
#[cfg(not(windows))]
eprintln!("Enter input. Use [CTRL+D] to stop:");
#[cfg(windows)]
eprintln!("Enter input. Use [CTRL+Z] to stop:");
}
let mut data = vec![];
io::stdin()
.lock()
.read_to_end(&mut data)
.map_err(StdinErr::Stdin)?;
Ok(data)
}
/// URL following error.
#[derive(Debug, Fail)]
pub enum StdinErr {
#[fail(display = "failed to read from stdin")]
Stdin(#[cause] io::Error),
}