mirror of
https://github.com/timvisee/ffsend.git
synced 2025-10-03 17:49:15 +02:00
Fix nonce auth, dependency, incorrect wording and warnings previous commits
This commit is contained in:
parent
7425c6c405
commit
dd65b51cb5
7 changed files with 13 additions and 18 deletions
|
@ -16,6 +16,7 @@ Features:
|
||||||
- Gentoo portage package
|
- Gentoo portage package
|
||||||
- Arch AUR package
|
- Arch AUR package
|
||||||
- Windows, macOS and Redox support
|
- Windows, macOS and Redox support
|
||||||
|
- Implement verbose logging with `-v`
|
||||||
- Allow empty owner token for info command
|
- Allow empty owner token for info command
|
||||||
- Check and validate all errors, are some too verbose?
|
- Check and validate all errors, are some too verbose?
|
||||||
|
|
||||||
|
@ -26,7 +27,6 @@ Features:
|
||||||
- Implement error handling everywhere properly
|
- Implement error handling everywhere properly
|
||||||
- Extract utility module
|
- Extract utility module
|
||||||
- Embed/wrap request errors with failure
|
- Embed/wrap request errors with failure
|
||||||
- Implement verbose logging with `-v`
|
|
||||||
- Box errors
|
- Box errors
|
||||||
- Allow piping input/output files
|
- Allow piping input/output files
|
||||||
- Allow hiding the progress bar, and/or showing simple progress (with `-q`)
|
- Allow hiding the progress bar, and/or showing simple progress (with `-q`)
|
||||||
|
|
|
@ -39,7 +39,7 @@ pub fn header_nonce(response: &Response)
|
||||||
.map_err(|_| NonceError::MalformedNonce)
|
.map_err(|_| NonceError::MalformedNonce)
|
||||||
)?
|
)?
|
||||||
.split_terminator(' ')
|
.split_terminator(' ')
|
||||||
.nth(2)
|
.nth(1)
|
||||||
.ok_or(NonceError::MalformedNonce)?
|
.ok_or(NonceError::MalformedNonce)?
|
||||||
).map_err(|_| NonceError::MalformedNonce)
|
).map_err(|_| NonceError::MalformedNonce)
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,12 +15,12 @@ name = "ffsend"
|
||||||
[features]
|
[features]
|
||||||
default = ["archive", "clipboard", "history"]
|
default = ["archive", "clipboard", "history"]
|
||||||
|
|
||||||
|
# Compile with file archiving support
|
||||||
|
archive = ["tar"]
|
||||||
|
|
||||||
# Compile with file history support
|
# Compile with file history support
|
||||||
history = []
|
history = []
|
||||||
|
|
||||||
# Compile with file archiving support
|
|
||||||
archive = []
|
|
||||||
|
|
||||||
# Compile without colored output support
|
# Compile without colored output support
|
||||||
no-color = ["colored/no-color"]
|
no-color = ["colored/no-color"]
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ prettytable-rs = "0.6"
|
||||||
rpassword = "2.0"
|
rpassword = "2.0"
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
tar = { version = "0.4", option = true }
|
tar = { version = "0.4", optional = true }
|
||||||
tempfile = "3"
|
tempfile = "3"
|
||||||
toml = "0.4"
|
toml = "0.4"
|
||||||
version-compare = "0.0.6"
|
version-compare = "0.0.6"
|
||||||
|
|
|
@ -9,14 +9,11 @@ use prettytable::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use cmd::matcher::{
|
use cmd::matcher::{
|
||||||
debug::DebugMatcher,
|
|
||||||
main::MainMatcher,
|
main::MainMatcher,
|
||||||
Matcher,
|
Matcher,
|
||||||
};
|
};
|
||||||
use error::ActionError;
|
use error::ActionError;
|
||||||
#[cfg(feature = "history")]
|
use util::format_duration;
|
||||||
use history_tool;
|
|
||||||
use util::{ensure_owner_token, format_duration, print_success};
|
|
||||||
|
|
||||||
/// A file debug action.
|
/// A file debug action.
|
||||||
pub struct Debug<'a> {
|
pub struct Debug<'a> {
|
||||||
|
@ -36,7 +33,6 @@ impl<'a> Debug<'a> {
|
||||||
pub fn invoke(&self) -> Result<(), ActionError> {
|
pub fn invoke(&self) -> Result<(), ActionError> {
|
||||||
// Create the command matchers
|
// Create the command matchers
|
||||||
let matcher_main = MainMatcher::with(self.cmd_matches).unwrap();
|
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
|
// Create a table for all debug information
|
||||||
let mut table = Table::new();
|
let mut table = Table::new();
|
||||||
|
@ -60,7 +56,7 @@ impl<'a> Debug<'a> {
|
||||||
Cell::new(&format_duration(Duration::seconds(SEND_DEFAULT_EXPIRE_TIME))),
|
Cell::new(&format_duration(Duration::seconds(SEND_DEFAULT_EXPIRE_TIME))),
|
||||||
]));
|
]));
|
||||||
|
|
||||||
// Print the table
|
// Print the debug table
|
||||||
table.printstd();
|
table.printstd();
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -129,7 +129,7 @@ impl<'a> Info<'a> {
|
||||||
// The file size
|
// The file size
|
||||||
let size = metadata.size();
|
let size = metadata.size();
|
||||||
table.add_row(Row::new(vec![
|
table.add_row(Row::new(vec![
|
||||||
Cell::new("MIME:"),
|
Cell::new("size:"),
|
||||||
Cell::new(
|
Cell::new(
|
||||||
&if size >= 1024 {
|
&if size >= 1024 {
|
||||||
format!("{} ({} B)", format_bytes(size), size)
|
format!("{} ({} B)", format_bytes(size), size)
|
||||||
|
@ -164,6 +164,9 @@ impl<'a> Info<'a> {
|
||||||
),
|
),
|
||||||
]));
|
]));
|
||||||
|
|
||||||
|
// Print the info table
|
||||||
|
table.printstd();
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
use ffsend_api::url::Url;
|
|
||||||
|
|
||||||
use clap::ArgMatches;
|
use clap::ArgMatches;
|
||||||
|
|
||||||
use cmd::arg::{ArgOwner, ArgPassword, ArgUrl, CmdArgOption};
|
|
||||||
use super::Matcher;
|
use super::Matcher;
|
||||||
|
|
||||||
/// The debug command matcher.
|
/// The debug command matcher.
|
||||||
pub struct DebugMatcher<'a> {
|
pub struct DebugMatcher<'a> {
|
||||||
|
#[allow(dead_code)]
|
||||||
matches: &'a ArgMatches<'a>,
|
matches: &'a ArgMatches<'a>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
use clap::{App, SubCommand};
|
use clap::{App, SubCommand};
|
||||||
|
|
||||||
use cmd::arg::{ArgOwner, ArgPassword, ArgUrl, CmdArg};
|
|
||||||
|
|
||||||
/// The debug command definition.
|
/// The debug command definition.
|
||||||
pub struct CmdDebug;
|
pub struct CmdDebug;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue