Browse Source

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

timvisee 7 years ago
parent
commit
dd65b51cb5

+ 1 - 1
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`)

+ 1 - 1
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)
 }

+ 4 - 4
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"

+ 2 - 6
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(())

+ 4 - 1
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(())
     }
 }

+ 1 - 3
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>,
 }
 

+ 0 - 2
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;