diff --git a/ROADMAP.md b/ROADMAP.md index 4f21e71..3e2a45c 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -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`) diff --git a/api/src/api/nonce.rs b/api/src/api/nonce.rs index 1955564..f855d20 100644 --- a/api/src/api/nonce.rs +++ b/api/src/api/nonce.rs @@ -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) } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index a9b98f3..76443aa 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -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" diff --git a/cli/src/action/debug.rs b/cli/src/action/debug.rs index b145f56..815e233 100644 --- a/cli/src/action/debug.rs +++ b/cli/src/action/debug.rs @@ -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(()) diff --git a/cli/src/action/info.rs b/cli/src/action/info.rs index 15d905c..cf95cd6 100644 --- a/cli/src/action/info.rs +++ b/cli/src/action/info.rs @@ -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(()) } } diff --git a/cli/src/cmd/matcher/debug.rs b/cli/src/cmd/matcher/debug.rs index 08107c0..0fe2bb0 100644 --- a/cli/src/cmd/matcher/debug.rs +++ b/cli/src/cmd/matcher/debug.rs @@ -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>, } diff --git a/cli/src/cmd/subcmd/debug.rs b/cli/src/cmd/subcmd/debug.rs index 057143e..e6e059a 100644 --- a/cli/src/cmd/subcmd/debug.rs +++ b/cli/src/cmd/subcmd/debug.rs @@ -1,7 +1,5 @@ use clap::{App, SubCommand}; -use cmd::arg::{ArgOwner, ArgPassword, ArgUrl, CmdArg}; - /// The debug command definition. pub struct CmdDebug;