Fix nonce auth, dependency, incorrect wording and warnings previous commits

This commit is contained in:
timvisee 2018-05-17 16:44:47 +02:00
parent 7425c6c405
commit dd65b51cb5
No known key found for this signature in database
GPG key ID: 109CBA0BF74036C2
7 changed files with 13 additions and 18 deletions

View file

@ -16,6 +16,7 @@ Features:
- Gentoo portage package
- Arch AUR package
- Windows, macOS and Redox support
- Implement verbose logging with `-v`
- Allow empty owner token for info command
- Check and validate all errors, are some too verbose?
@ -26,7 +27,6 @@ Features:
- Implement error handling everywhere properly
- Extract utility module
- Embed/wrap request errors with failure
- Implement verbose logging with `-v`
- Box errors
- Allow piping input/output files
- Allow hiding the progress bar, and/or showing simple progress (with `-q`)

View file

@ -39,7 +39,7 @@ pub fn header_nonce(response: &Response)
.map_err(|_| NonceError::MalformedNonce)
)?
.split_terminator(' ')
.nth(2)
.nth(1)
.ok_or(NonceError::MalformedNonce)?
).map_err(|_| NonceError::MalformedNonce)
}

View file

@ -15,12 +15,12 @@ name = "ffsend"
[features]
default = ["archive", "clipboard", "history"]
# Compile with file archiving support
archive = ["tar"]
# Compile with file history support
history = []
# Compile with file archiving support
archive = []
# Compile without colored output support
no-color = ["colored/no-color"]
@ -42,7 +42,7 @@ prettytable-rs = "0.6"
rpassword = "2.0"
serde = "1.0"
serde_derive = "1.0"
tar = { version = "0.4", option = true }
tar = { version = "0.4", optional = true }
tempfile = "3"
toml = "0.4"
version-compare = "0.0.6"

View file

@ -9,14 +9,11 @@ use prettytable::{
};
use cmd::matcher::{
debug::DebugMatcher,
main::MainMatcher,
Matcher,
};
use error::ActionError;
#[cfg(feature = "history")]
use history_tool;
use util::{ensure_owner_token, format_duration, print_success};
use util::format_duration;
/// A file debug action.
pub struct Debug<'a> {
@ -36,7 +33,6 @@ impl<'a> Debug<'a> {
pub fn invoke(&self) -> Result<(), ActionError> {
// Create the command matchers
let matcher_main = MainMatcher::with(self.cmd_matches).unwrap();
let matcher_debug = DebugMatcher::with(self.cmd_matches).unwrap();
// Create a table for all debug information
let mut table = Table::new();
@ -60,7 +56,7 @@ impl<'a> Debug<'a> {
Cell::new(&format_duration(Duration::seconds(SEND_DEFAULT_EXPIRE_TIME))),
]));
// Print the table
// Print the debug table
table.printstd();
Ok(())

View file

@ -129,7 +129,7 @@ impl<'a> Info<'a> {
// The file size
let size = metadata.size();
table.add_row(Row::new(vec![
Cell::new("MIME:"),
Cell::new("size:"),
Cell::new(
&if size >= 1024 {
format!("{} ({} B)", format_bytes(size), size)
@ -164,6 +164,9 @@ impl<'a> Info<'a> {
),
]));
// Print the info table
table.printstd();
Ok(())
}
}

View file

@ -1,12 +1,10 @@
use ffsend_api::url::Url;
use clap::ArgMatches;
use cmd::arg::{ArgOwner, ArgPassword, ArgUrl, CmdArgOption};
use super::Matcher;
/// The debug command matcher.
pub struct DebugMatcher<'a> {
#[allow(dead_code)]
matches: &'a ArgMatches<'a>,
}

View file

@ -1,7 +1,5 @@
use clap::{App, SubCommand};
use cmd::arg::{ArgOwner, ArgPassword, ArgUrl, CmdArg};
/// The debug command definition.
pub struct CmdDebug;