Merge remote-tracking branch 'origin/master' into gitlab-ci-snap2
This commit is contained in:
commit
48d0b4f48d
44 changed files with 647 additions and 532 deletions
|
@ -132,6 +132,52 @@ crate:
|
|||
- echo "Publishing crate to crates.io..."
|
||||
- cargo publish --verbose --allow-dirty
|
||||
|
||||
# AUR package release
|
||||
pkg-aur:
|
||||
image: base/archlinux
|
||||
stage: release
|
||||
only:
|
||||
- /^v(\d+\.)*\d+$/
|
||||
before_script: []
|
||||
script:
|
||||
- cd ./pkg/aur
|
||||
|
||||
# Update version number in PKGBUILD
|
||||
- VERSION=$(echo $CI_COMMIT_REF_NAME | cut -c 2-)
|
||||
- echo "Determined binary version number 'v$VERSION', updating PKGBUILD..."
|
||||
- sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i PKGBUILD
|
||||
|
||||
# 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
|
||||
- sudo -u nobody makepkg -c
|
||||
- sudo -u nobody makepkg --printsrcinfo > .SRCINFO
|
||||
|
||||
# Publish: set up SSH key, clone AUR repo, commit update and push
|
||||
- mkdir -p /root/.ssh
|
||||
- cp ./aur.pub /root/.ssh/id_rsa.pub
|
||||
- echo "$AUR_SSH_PRIVATE" > /root/.ssh/id_rsa
|
||||
- echo "Host aur.archlinux.org" >> /root/.ssh/config
|
||||
- echo " IdentityFile /root/.ssh/aur" >> /root/.ssh/config
|
||||
- echo " User aur" >> /root/.ssh/config
|
||||
- chmod 600 /root/.ssh/{id_rsa*,config}
|
||||
- eval `ssh-agent -s`
|
||||
- ssh-add /root/.ssh/id_rsa
|
||||
- ssh-keyscan -H aur.archlinux.org >> /root/.ssh/known_hosts
|
||||
- git config --global user.name "timvisee"
|
||||
- git config --global user.email "timvisee@gmail.com"
|
||||
- git clone ssh://aur@aur.archlinux.org/ffsend.git aur-ffsend
|
||||
- cd aur-ffsend
|
||||
- cp ../{PKGBUILD,.SRCINFO} ./
|
||||
- git add PKGBUILD .SRCINFO
|
||||
- git commit -m "Release v$VERSION"
|
||||
- git push
|
||||
|
||||
# Snap release
|
||||
snap:
|
||||
image: snapcore/snapcraft:edge
|
||||
|
|
850
Cargo.lock
generated
850
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "ffsend"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
authors = ["Tim Visee <timvisee@gmail.com>"]
|
||||
license = "GPL-3.0"
|
||||
readme = "README.md"
|
||||
|
@ -21,6 +21,7 @@ categories = [
|
|||
exclude = [
|
||||
"res/*",
|
||||
]
|
||||
edition = "2018"
|
||||
|
||||
[package.metadata.deb]
|
||||
section = "utility"
|
||||
|
@ -64,7 +65,7 @@ no-color = ["colored/no-color"]
|
|||
chbs = "0.0.8"
|
||||
chrono = "0.4"
|
||||
clap = "2.31"
|
||||
colored = "1.6"
|
||||
colored = "1.7"
|
||||
derive_builder = "0.7"
|
||||
directories = "1.0"
|
||||
failure = "0.1"
|
||||
|
@ -75,7 +76,7 @@ open = "1"
|
|||
openssl-probe = "0.1"
|
||||
pbr = "1"
|
||||
prettytable-rs = "0.8"
|
||||
rpassword = "2.0"
|
||||
rpassword = "2.1"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
tar = { version = "0.4", optional = true }
|
||||
|
|
40
README.md
40
README.md
|
@ -146,15 +146,25 @@ all available subcommands.
|
|||
Because `ffsend` is still in alpha, only limited installation options are
|
||||
available right now.
|
||||
|
||||
A set of pre-build binaries for Linux and macOS can be found as asset of the
|
||||
It is recommended to build and install `ffsend` yourself using these fairly
|
||||
easy steps [below](#build).
|
||||
|
||||
#### Arch AUR package
|
||||
[» `ffsend` on `aur.archlinux.org`][aur-ffsend]
|
||||
|
||||
```bash
|
||||
yaourt -S ffsend
|
||||
# or
|
||||
yay ffsend
|
||||
# or using any other AUR installer
|
||||
```
|
||||
|
||||
#### Prebuilt binaries
|
||||
A set of prebuilt binaries for Linux and macOS can be found as asset of the
|
||||
[latest release][github-latest-release]. When downloading such release, mark
|
||||
the binary as executable using `chmod a+x ffsend`, and move it into `/usr/bin/`.
|
||||
|
||||
A Windows binary and packaged versions for various Linux distributions is
|
||||
currently being worked on.
|
||||
|
||||
It is recommended to build and install `ffsend` yourself using these fairly
|
||||
easy steps [here](#build).
|
||||
If running the binary fails (probably due to some linked library), please feel
|
||||
free to [open an issue](https://gitlab.com/timvisee/ffsend/issues).
|
||||
|
||||
## Build
|
||||
To build and install `ffsend` yourself, you meet the following requirements
|
||||
|
@ -163,16 +173,17 @@ before proceeding:
|
|||
### Build requirements
|
||||
- Regular [requirements](#requirements)
|
||||
- [`git`][git]
|
||||
- [`rust`][rust] `v1.26` or higher (install using [`rustup`][rustup])
|
||||
- [`rust`][rust] `v1.31` or higher (install using [`rustup`][rustup])
|
||||
- [OpenSSL][openssl] or [LibreSSL][libressl] libraries and headers must be available
|
||||
- Linux:
|
||||
- Ubuntu/Debian: `apt install pkg-config libssl-dev`
|
||||
- CentOS/Red Hat/openSUSE: `yum install openssl-devel`
|
||||
- Arch: `pacman -S openssl`
|
||||
- Fedora: `dnf install openssl-devel`
|
||||
- Ubuntu/Debian: `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)
|
||||
- macOS:
|
||||
- Using `brew`: `brew install openssl`
|
||||
- Using `brew`: `brew install cmake pkg-config openssl`
|
||||
- Or see instructions [here](https://github.com/sfackler/rust-openssl#osx)
|
||||
- Windows:
|
||||
- See instructions here [here](https://github.com/sfackler/rust-openssl#windows-msvc)
|
||||
|
@ -330,7 +341,7 @@ documentation [here][send-encryption].
|
|||
```
|
||||
$ ffsend help
|
||||
|
||||
ffsend 0.1.1
|
||||
ffsend 0.1.2
|
||||
Tim Visee <timvisee.com>
|
||||
Easily and securely share files from the command line.
|
||||
A fully featured Firefox Send client.
|
||||
|
@ -394,3 +405,4 @@ Check out the [LICENSE](LICENSE) file for more information.
|
|||
[asciinema]: https://asciinema.org/
|
||||
[svg-term]: https://github.com/marionebl/svg-term-cli
|
||||
[github-latest-release]: https://github.com/timvisee/ffsend/releases/latest
|
||||
[aur-ffsend]: https://aur.archlinux.org/packages/ffsend/
|
||||
|
|
29
pkg/aur/PKGBUILD
Normal file
29
pkg/aur/PKGBUILD
Normal file
|
@ -0,0 +1,29 @@
|
|||
# Maintainer: Tim Visee <timvisee@gmail.com>
|
||||
|
||||
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')
|
||||
source=("$pkgname-v$pkgver.tar.gz::$url/-/archive/v$pkgver/$pkgname-v$pkgver.tar.gz")
|
||||
sha256sums=('SKIP')
|
||||
arch=('x86_64' 'i686')
|
||||
depends=('ca-certificates')
|
||||
makedepends=('openssl>=1.0' 'rust' 'cargo' 'cmake')
|
||||
optdepends=('xclip: clipboard support')
|
||||
|
||||
pkgver() {
|
||||
cd "$pkgname-v$pkgver"
|
||||
echo "$(grep '^version =' Cargo.toml|head -n1|cut -d\" -f2)"
|
||||
#.$(git rev-list --count HEAD).g$(git rev-parse --short HEAD)
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$pkgname-v$pkgver"
|
||||
env CARGO_INCREMENTAL=0 cargo build --release
|
||||
}
|
||||
|
||||
package() {
|
||||
install -Dm755 "$srcdir/$pkgname-v$pkgver/target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"
|
||||
}
|
1
pkg/aur/aur.pub
Normal file
1
pkg/aur/aur.pub
Normal file
|
@ -0,0 +1 @@
|
|||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDHfiNi+rOCPKGLB6v9uuYR6GkN6Zd+CdaRbV82A26AUzs48ZG0xZGXHsoRuZY/yCUhcrS2u9xZ16fsAxnyf1QCF1hZVABUYtNhL1eEbSbLNiG9vIWJzbRjgegN/yyiG9ZVhFfNqXtPeapvuM3H44a2XeeFJcvTOfj/alkVjypi/DY/+XpC1IlX+CARC/e0zXHa3KZohn+CfBj8kWZWQEr7+EtKT59pslNxuJPcDUw7sKYLcBBz00BT0vv3lntyvZI1rRsD7AvItOwSZPp6or78Tgp8+O0HvFpjrlNipPEqDPpETIPcjTIVAlvlPFK1J0Rpzud38YdoWGfPiM77k7L7 timvisee@aur
|
|
@ -3,10 +3,10 @@ use clap::ArgMatches;
|
|||
use ffsend_api::config::SEND_DEFAULT_EXPIRE_TIME;
|
||||
use prettytable::{format::FormatBuilder, Cell, Row, Table};
|
||||
|
||||
use client::to_duration;
|
||||
use cmd::matcher::{debug::DebugMatcher, main::MainMatcher, Matcher};
|
||||
use error::ActionError;
|
||||
use util::{features_list, format_bool, format_duration};
|
||||
use crate::client::to_duration;
|
||||
use crate::cmd::matcher::{debug::DebugMatcher, main::MainMatcher, Matcher};
|
||||
use crate::error::ActionError;
|
||||
use crate::util::{features_list, format_bool, format_duration};
|
||||
|
||||
/// A file debug action.
|
||||
pub struct Debug<'a> {
|
||||
|
|
|
@ -2,12 +2,12 @@ use clap::ArgMatches;
|
|||
use ffsend_api::action::delete::{Delete as ApiDelete, Error as DeleteError};
|
||||
use ffsend_api::file::remote_file::{FileParseError, RemoteFile};
|
||||
|
||||
use client::create_client;
|
||||
use cmd::matcher::{delete::DeleteMatcher, main::MainMatcher, Matcher};
|
||||
use error::ActionError;
|
||||
use crate::client::create_client;
|
||||
use crate::cmd::matcher::{delete::DeleteMatcher, main::MainMatcher, Matcher};
|
||||
use crate::error::ActionError;
|
||||
#[cfg(feature = "history")]
|
||||
use history_tool;
|
||||
use util::{ensure_owner_token, print_success};
|
||||
use crate::history_tool;
|
||||
use crate::util::{ensure_owner_token, print_success};
|
||||
|
||||
/// A file delete action.
|
||||
pub struct Delete<'a> {
|
||||
|
|
|
@ -16,13 +16,13 @@ use ffsend_api::reader::ProgressReporter;
|
|||
use tempfile::{Builder as TempBuilder, NamedTempFile};
|
||||
|
||||
#[cfg(feature = "archive")]
|
||||
use archive::archive::Archive;
|
||||
use client::create_transfer_client;
|
||||
use cmd::matcher::{download::DownloadMatcher, main::MainMatcher, Matcher};
|
||||
use crate::archive::archive::Archive;
|
||||
use crate::client::create_transfer_client;
|
||||
use crate::cmd::matcher::{download::DownloadMatcher, main::MainMatcher, Matcher};
|
||||
#[cfg(feature = "history")]
|
||||
use history_tool;
|
||||
use progress::ProgressBar;
|
||||
use util::{
|
||||
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,
|
||||
};
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@ use clap::ArgMatches;
|
|||
use ffsend_api::action::exists::{Error as ExistsError, Exists as ApiExists};
|
||||
use ffsend_api::file::remote_file::{FileParseError, RemoteFile};
|
||||
|
||||
use client::create_client;
|
||||
use cmd::matcher::main::MainMatcher;
|
||||
use cmd::matcher::{exists::ExistsMatcher, Matcher};
|
||||
use error::ActionError;
|
||||
use crate::client::create_client;
|
||||
use crate::cmd::matcher::main::MainMatcher;
|
||||
use crate::cmd::matcher::{exists::ExistsMatcher, Matcher};
|
||||
use crate::error::ActionError;
|
||||
#[cfg(feature = "history")]
|
||||
use history_tool;
|
||||
use crate::history_tool;
|
||||
|
||||
/// A file exists action.
|
||||
pub struct Exists<'a> {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use clap::ArgMatches;
|
||||
use prettytable::{format::FormatBuilder, Cell, Row, Table};
|
||||
|
||||
use cmd::matcher::{main::MainMatcher, Matcher};
|
||||
use error::ActionError;
|
||||
use history::{History as HistoryManager, LoadError as HistoryLoadError};
|
||||
use util::format_duration;
|
||||
use crate::cmd::matcher::{main::MainMatcher, Matcher};
|
||||
use crate::error::ActionError;
|
||||
use crate::history::{History as HistoryManager, LoadError as HistoryLoadError};
|
||||
use crate::util::format_duration;
|
||||
|
||||
/// A history action.
|
||||
pub struct History<'a> {
|
||||
|
|
|
@ -7,11 +7,13 @@ use ffsend_api::action::metadata::Metadata as ApiMetadata;
|
|||
use ffsend_api::file::remote_file::{FileParseError, RemoteFile};
|
||||
use prettytable::{format::FormatBuilder, Cell, Row, Table};
|
||||
|
||||
use client::create_client;
|
||||
use cmd::matcher::{info::InfoMatcher, main::MainMatcher, Matcher};
|
||||
use crate::client::create_client;
|
||||
use crate::cmd::matcher::{info::InfoMatcher, main::MainMatcher, Matcher};
|
||||
#[cfg(feature = "history")]
|
||||
use history_tool;
|
||||
use util::{ensure_owner_token, ensure_password, format_bytes, format_duration, print_error};
|
||||
use crate::history_tool;
|
||||
use crate::util::{
|
||||
ensure_owner_token, ensure_password, format_bytes, format_duration, print_error,
|
||||
};
|
||||
|
||||
/// A file info action.
|
||||
pub struct Info<'a> {
|
||||
|
|
|
@ -2,12 +2,12 @@ use clap::ArgMatches;
|
|||
use ffsend_api::action::params::{Error as ParamsError, Params as ApiParams, ParamsDataBuilder};
|
||||
use ffsend_api::file::remote_file::RemoteFile;
|
||||
|
||||
use client::create_client;
|
||||
use cmd::matcher::{main::MainMatcher, params::ParamsMatcher, Matcher};
|
||||
use error::ActionError;
|
||||
use crate::client::create_client;
|
||||
use crate::cmd::matcher::{main::MainMatcher, params::ParamsMatcher, Matcher};
|
||||
use crate::error::ActionError;
|
||||
#[cfg(feature = "history")]
|
||||
use history_tool;
|
||||
use util::{ensure_owner_token, print_success};
|
||||
use crate::history_tool;
|
||||
use crate::util::{ensure_owner_token, print_success};
|
||||
|
||||
/// A file parameters action.
|
||||
pub struct Params<'a> {
|
||||
|
|
|
@ -3,12 +3,12 @@ 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 client::create_client;
|
||||
use cmd::matcher::{main::MainMatcher, password::PasswordMatcher, Matcher};
|
||||
use error::ActionError;
|
||||
use crate::client::create_client;
|
||||
use crate::cmd::matcher::{main::MainMatcher, password::PasswordMatcher, Matcher};
|
||||
use crate::error::ActionError;
|
||||
#[cfg(feature = "history")]
|
||||
use history_tool;
|
||||
use util::{ensure_owner_token, print_success};
|
||||
use crate::history_tool;
|
||||
use crate::util::{ensure_owner_token, print_success};
|
||||
|
||||
/// A file password action.
|
||||
pub struct Password<'a> {
|
||||
|
|
|
@ -15,15 +15,15 @@ use prettytable::{format::FormatBuilder, Cell, Row, Table};
|
|||
use tempfile::{Builder as TempBuilder, NamedTempFile};
|
||||
|
||||
#[cfg(feature = "archive")]
|
||||
use archive::archiver::Archiver;
|
||||
use client::create_transfer_client;
|
||||
use cmd::matcher::{MainMatcher, Matcher, UploadMatcher};
|
||||
use crate::archive::archiver::Archiver;
|
||||
use crate::client::create_transfer_client;
|
||||
use crate::cmd::matcher::{MainMatcher, Matcher, UploadMatcher};
|
||||
#[cfg(feature = "history")]
|
||||
use history_tool;
|
||||
use progress::ProgressBar;
|
||||
use crate::history_tool;
|
||||
use crate::progress::ProgressBar;
|
||||
#[cfg(feature = "clipboard")]
|
||||
use util::set_clipboard;
|
||||
use util::{
|
||||
use crate::util::set_clipboard;
|
||||
use crate::util::{
|
||||
format_bytes, open_url, print_error, print_error_msg, prompt_yes, quit, quit_error_msg,
|
||||
ErrorHintsBuilder,
|
||||
};
|
||||
|
@ -99,7 +99,7 @@ impl<'a> Upload<'a> {
|
|||
// Build a parameters object to set for the file
|
||||
let params = {
|
||||
// Build the parameters data object
|
||||
let mut params = ParamsDataBuilder::default()
|
||||
let params = ParamsDataBuilder::default()
|
||||
.download_limit(matcher_upload.download_limit())
|
||||
.build()
|
||||
.unwrap();
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::time::Duration;
|
|||
|
||||
use ffsend_api::reqwest::{Client, ClientBuilder};
|
||||
|
||||
use cmd::matcher::MainMatcher;
|
||||
use crate::cmd::matcher::MainMatcher;
|
||||
|
||||
/// Create the default client, which is used for generic Send requests.
|
||||
///
|
||||
|
|
|
@ -5,7 +5,7 @@ use ffsend_api::action::params::{
|
|||
|
||||
use super::{CmdArg, CmdArgFlag, CmdArgOption};
|
||||
|
||||
use util::{quit_error_msg, ErrorHintsBuilder};
|
||||
use crate::util::{quit_error_msg, ErrorHintsBuilder};
|
||||
|
||||
/// The download limit argument.
|
||||
pub struct ArgDownloadLimit {}
|
||||
|
|
|
@ -4,8 +4,8 @@ use ffsend_api::config::SEND_DEFAULT_HOST;
|
|||
use ffsend_api::url::Url;
|
||||
|
||||
use super::{CmdArg, CmdArgOption};
|
||||
use host::parse_host;
|
||||
use util::{quit_error, ErrorHints};
|
||||
use crate::host::parse_host;
|
||||
use crate::util::{quit_error, ErrorHints};
|
||||
|
||||
/// The host argument.
|
||||
pub struct ArgHost {}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use clap::{Arg, ArgMatches};
|
||||
|
||||
use super::{CmdArg, CmdArgFlag, CmdArgOption};
|
||||
use cmd::matcher::{MainMatcher, Matcher};
|
||||
use util::prompt_owner_token;
|
||||
use crate::cmd::matcher::{MainMatcher, Matcher};
|
||||
use crate::util::prompt_owner_token;
|
||||
|
||||
/// The owner argument.
|
||||
pub struct ArgOwner {}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use clap::{Arg, ArgMatches};
|
||||
|
||||
use super::{CmdArg, CmdArgFlag, CmdArgOption};
|
||||
use cmd::matcher::{MainMatcher, Matcher};
|
||||
use util::{check_empty_password, prompt_password};
|
||||
use crate::cmd::matcher::{MainMatcher, Matcher};
|
||||
use crate::util::{check_empty_password, prompt_password};
|
||||
|
||||
/// The password argument.
|
||||
pub struct ArgPassword {}
|
||||
|
|
|
@ -3,8 +3,8 @@ use failure::Fail;
|
|||
use ffsend_api::url::Url;
|
||||
|
||||
use super::{CmdArg, CmdArgOption};
|
||||
use host::parse_host;
|
||||
use util::{quit_error, ErrorHints};
|
||||
use crate::host::parse_host;
|
||||
use crate::util::{quit_error, ErrorHints};
|
||||
|
||||
/// The URL argument.
|
||||
pub struct ArgUrl {}
|
||||
|
|
|
@ -13,9 +13,9 @@ use super::subcmd::CmdHistory;
|
|||
use super::subcmd::{
|
||||
CmdDebug, CmdDelete, CmdDownload, CmdExists, CmdInfo, CmdParams, CmdPassword, CmdUpload,
|
||||
};
|
||||
use config::{CLIENT_TIMEOUT, CLIENT_TRANSFER_TIMEOUT};
|
||||
use crate::config::{CLIENT_TIMEOUT, CLIENT_TRANSFER_TIMEOUT};
|
||||
#[cfg(feature = "history")]
|
||||
use util::app_history_file_path_string;
|
||||
use crate::util::app_history_file_path_string;
|
||||
|
||||
#[cfg(feature = "history")]
|
||||
lazy_static! {
|
||||
|
|
|
@ -2,7 +2,7 @@ use clap::ArgMatches;
|
|||
use ffsend_api::url::Url;
|
||||
|
||||
use super::Matcher;
|
||||
use cmd::arg::{ArgHost, CmdArgOption};
|
||||
use crate::cmd::arg::{ArgHost, CmdArgOption};
|
||||
|
||||
/// The debug command matcher.
|
||||
pub struct DebugMatcher<'a> {
|
||||
|
|
|
@ -2,7 +2,7 @@ use clap::ArgMatches;
|
|||
use ffsend_api::url::Url;
|
||||
|
||||
use super::Matcher;
|
||||
use cmd::arg::{ArgOwner, ArgUrl, CmdArgOption};
|
||||
use crate::cmd::arg::{ArgOwner, ArgUrl, CmdArgOption};
|
||||
|
||||
/// The delete command matcher.
|
||||
pub struct DeleteMatcher<'a> {
|
||||
|
|
|
@ -4,9 +4,9 @@ use clap::ArgMatches;
|
|||
use ffsend_api::url::Url;
|
||||
|
||||
use super::Matcher;
|
||||
use cmd::arg::{ArgPassword, ArgUrl, CmdArgOption};
|
||||
use crate::cmd::arg::{ArgPassword, ArgUrl, CmdArgOption};
|
||||
#[cfg(feature = "archive")]
|
||||
use util::env_var_present;
|
||||
use crate::util::env_var_present;
|
||||
|
||||
/// The download command matcher.
|
||||
pub struct DownloadMatcher<'a> {
|
||||
|
|
|
@ -3,7 +3,7 @@ use ffsend_api::url::Url;
|
|||
use clap::ArgMatches;
|
||||
|
||||
use super::Matcher;
|
||||
use cmd::arg::{ArgUrl, CmdArgOption};
|
||||
use crate::cmd::arg::{ArgUrl, CmdArgOption};
|
||||
|
||||
/// The exists command matcher.
|
||||
pub struct ExistsMatcher<'a> {
|
||||
|
|
|
@ -3,7 +3,7 @@ use ffsend_api::url::Url;
|
|||
use clap::ArgMatches;
|
||||
|
||||
use super::Matcher;
|
||||
use cmd::arg::{ArgOwner, ArgPassword, ArgUrl, CmdArgOption};
|
||||
use crate::cmd::arg::{ArgOwner, ArgPassword, ArgUrl, CmdArgOption};
|
||||
|
||||
/// The info command matcher.
|
||||
pub struct InfoMatcher<'a> {
|
||||
|
|
|
@ -4,9 +4,9 @@ use std::path::PathBuf;
|
|||
use clap::ArgMatches;
|
||||
|
||||
use super::Matcher;
|
||||
use util::env_var_present;
|
||||
use crate::util::env_var_present;
|
||||
#[cfg(feature = "history")]
|
||||
use util::{quit_error_msg, ErrorHintsBuilder};
|
||||
use crate::util::{quit_error_msg, ErrorHintsBuilder};
|
||||
|
||||
/// The main command matcher.
|
||||
pub struct MainMatcher<'a> {
|
||||
|
|
|
@ -2,7 +2,7 @@ use clap::ArgMatches;
|
|||
use ffsend_api::url::Url;
|
||||
|
||||
use super::Matcher;
|
||||
use cmd::arg::{ArgDownloadLimit, ArgOwner, ArgUrl, CmdArgOption};
|
||||
use crate::cmd::arg::{ArgDownloadLimit, ArgOwner, ArgUrl, CmdArgOption};
|
||||
|
||||
/// The params command matcher.
|
||||
pub struct ParamsMatcher<'a> {
|
||||
|
|
|
@ -2,9 +2,9 @@ use clap::ArgMatches;
|
|||
use ffsend_api::url::Url;
|
||||
use rpassword::prompt_password_stderr;
|
||||
|
||||
use cmd::arg::{ArgGenPassphrase, ArgOwner, ArgPassword, ArgUrl, CmdArgFlag, CmdArgOption};
|
||||
use cmd::matcher::{MainMatcher, Matcher};
|
||||
use util::check_empty_password;
|
||||
use crate::cmd::arg::{ArgGenPassphrase, ArgOwner, ArgPassword, ArgUrl, CmdArgFlag, CmdArgOption};
|
||||
use crate::cmd::matcher::{MainMatcher, Matcher};
|
||||
use crate::util::check_empty_password;
|
||||
|
||||
/// The password command matcher.
|
||||
pub struct PasswordMatcher<'a> {
|
||||
|
|
|
@ -3,10 +3,10 @@ use ffsend_api::action::params::PARAMS_DEFAULT_DOWNLOAD as DOWNLOAD_DEFAULT;
|
|||
use ffsend_api::url::Url;
|
||||
|
||||
use super::Matcher;
|
||||
use cmd::arg::{
|
||||
use crate::cmd::arg::{
|
||||
ArgDownloadLimit, ArgGenPassphrase, ArgHost, ArgPassword, CmdArgFlag, CmdArgOption,
|
||||
};
|
||||
use util::{env_var_present, quit_error_msg, ErrorHintsBuilder};
|
||||
use crate::util::{env_var_present, quit_error_msg, ErrorHintsBuilder};
|
||||
|
||||
/// The upload command matcher.
|
||||
pub struct UploadMatcher<'a> {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use clap::{App, SubCommand};
|
||||
|
||||
use cmd::arg::{ArgHost, CmdArg};
|
||||
use crate::cmd::arg::{ArgHost, CmdArg};
|
||||
|
||||
/// The debug command definition.
|
||||
pub struct CmdDebug;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use clap::{App, SubCommand};
|
||||
|
||||
use cmd::arg::{ArgOwner, ArgUrl, CmdArg};
|
||||
use crate::cmd::arg::{ArgOwner, ArgUrl, CmdArg};
|
||||
|
||||
/// The delete command definition.
|
||||
pub struct CmdDelete;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use clap::{App, Arg, SubCommand};
|
||||
|
||||
use cmd::arg::{ArgPassword, ArgUrl, CmdArg};
|
||||
use crate::cmd::arg::{ArgPassword, ArgUrl, CmdArg};
|
||||
|
||||
/// The download command definition.
|
||||
pub struct CmdDownload;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use clap::{App, SubCommand};
|
||||
|
||||
use cmd::arg::{ArgUrl, CmdArg};
|
||||
use crate::cmd::arg::{ArgUrl, CmdArg};
|
||||
|
||||
/// The exists command definition.
|
||||
pub struct CmdExists;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use clap::{App, SubCommand};
|
||||
|
||||
use cmd::arg::{ArgOwner, ArgPassword, ArgUrl, CmdArg};
|
||||
use crate::cmd::arg::{ArgOwner, ArgPassword, ArgUrl, CmdArg};
|
||||
|
||||
/// The info command definition.
|
||||
pub struct CmdInfo;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use clap::{App, SubCommand};
|
||||
|
||||
use cmd::arg::{ArgDownloadLimit, ArgOwner, ArgUrl, CmdArg};
|
||||
use crate::cmd::arg::{ArgDownloadLimit, ArgOwner, ArgUrl, CmdArg};
|
||||
|
||||
/// The params command definition.
|
||||
pub struct CmdParams;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use clap::{App, SubCommand};
|
||||
|
||||
use cmd::arg::{ArgGenPassphrase, ArgOwner, ArgPassword, ArgUrl, CmdArg};
|
||||
use crate::cmd::arg::{ArgGenPassphrase, ArgOwner, ArgPassword, ArgUrl, CmdArg};
|
||||
|
||||
/// The password command definition.
|
||||
pub struct CmdPassword;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use clap::{App, Arg, SubCommand};
|
||||
use ffsend_api::action::params::PARAMS_DEFAULT_DOWNLOAD_STR as DOWNLOAD_DEFAULT;
|
||||
|
||||
use cmd::arg::{ArgDownloadLimit, ArgGenPassphrase, ArgHost, ArgPassword, CmdArg};
|
||||
use crate::cmd::arg::{ArgDownloadLimit, ArgGenPassphrase, ArgHost, ArgPassword, CmdArg};
|
||||
|
||||
/// The upload command definition.
|
||||
pub struct CmdUpload;
|
||||
|
|
|
@ -4,11 +4,11 @@ use ffsend_api::action::params::Error as ParamsError;
|
|||
use ffsend_api::action::password::Error as PasswordError;
|
||||
use ffsend_api::file::remote_file::FileParseError;
|
||||
|
||||
use action::download::Error as CliDownloadError;
|
||||
use crate::action::download::Error as CliDownloadError;
|
||||
#[cfg(feature = "history")]
|
||||
use action::history::Error as CliHistoryError;
|
||||
use action::info::Error as CliInfoError;
|
||||
use action::upload::Error as CliUploadError;
|
||||
use crate::action::history::Error as CliHistoryError;
|
||||
use crate::action::info::Error as CliInfoError;
|
||||
use crate::action::upload::Error as CliUploadError;
|
||||
|
||||
#[derive(Fail, Debug)]
|
||||
pub enum Error {
|
||||
|
|
|
@ -11,7 +11,7 @@ use self::version_compare::{CompOp, VersionCompare};
|
|||
use failure::Fail;
|
||||
use ffsend_api::file::remote_file::RemoteFile;
|
||||
|
||||
use util::{print_error, print_warning};
|
||||
use crate::util::{print_error, print_warning};
|
||||
|
||||
/// The minimum supported history file version.
|
||||
const VERSION_MIN: &str = "0.0.1";
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use failure::Fail;
|
||||
use ffsend_api::file::remote_file::RemoteFile;
|
||||
|
||||
use cmd::matcher::MainMatcher;
|
||||
use history::{Error as HistoryError, History};
|
||||
use util::print_error;
|
||||
use crate::cmd::matcher::MainMatcher;
|
||||
use crate::history::{Error as HistoryError, History};
|
||||
use crate::util::print_error;
|
||||
|
||||
/// Load the history from the given path, add the given file, and save it
|
||||
/// again.
|
||||
|
|
24
src/main.rs
24
src/main.rs
|
@ -33,22 +33,22 @@ mod host;
|
|||
mod progress;
|
||||
mod util;
|
||||
|
||||
use action::debug::Debug;
|
||||
use action::delete::Delete;
|
||||
use action::download::Download;
|
||||
use action::exists::Exists;
|
||||
use crate::action::debug::Debug;
|
||||
use crate::action::delete::Delete;
|
||||
use crate::action::download::Download;
|
||||
use crate::action::exists::Exists;
|
||||
#[cfg(feature = "history")]
|
||||
use action::history::History;
|
||||
use action::info::Info;
|
||||
use action::params::Params;
|
||||
use action::password::Password;
|
||||
use action::upload::Upload;
|
||||
use cmd::{
|
||||
use crate::action::history::History;
|
||||
use crate::action::info::Info;
|
||||
use crate::action::params::Params;
|
||||
use crate::action::password::Password;
|
||||
use crate::action::upload::Upload;
|
||||
use crate::cmd::{
|
||||
matcher::{MainMatcher, Matcher},
|
||||
Handler,
|
||||
};
|
||||
use error::Error;
|
||||
use util::{bin_name, highlight, quit_error, ErrorHints};
|
||||
use crate::error::Error;
|
||||
use crate::util::{bin_name, highlight, quit_error, ErrorHints};
|
||||
|
||||
/// Application entrypoint.
|
||||
fn main() {
|
||||
|
|
|
@ -32,7 +32,7 @@ use failure::{Compat, Error};
|
|||
use ffsend_api::url::Url;
|
||||
use rpassword::prompt_password_stderr;
|
||||
|
||||
use cmd::matcher::MainMatcher;
|
||||
use crate::cmd::matcher::MainMatcher;
|
||||
|
||||
/// Print a success message.
|
||||
pub fn print_success(msg: &str) {
|
||||
|
@ -297,7 +297,7 @@ pub fn set_clipboard(content: String) -> Result<(), ClipboardError> {
|
|||
return Err(match err.kind() {
|
||||
IoErrorKind::NotFound => ClipboardError::NoXclip,
|
||||
_ => ClipboardError::Xclip(err),
|
||||
})
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue