mirror of
https://github.com/timvisee/ffsend.git
synced 2025-10-04 09:59:17 +02:00
Make file expiry time configurable, update ffsend-api to v0.4.0-git
This commit is contained in:
parent
9076744ead
commit
e39add8ffd
8 changed files with 209 additions and 19 deletions
|
@ -5,7 +5,10 @@ use ffsend_api::url::Url;
|
|||
|
||||
use super::Matcher;
|
||||
use crate::cmd::{
|
||||
arg::{ArgDownloadLimit, ArgGenPassphrase, ArgHost, ArgPassword, CmdArgFlag, CmdArgOption},
|
||||
arg::{
|
||||
ArgDownloadLimit, ArgExpiryTime, ArgGenPassphrase, ArgHost, ArgPassword, CmdArgFlag,
|
||||
CmdArgOption,
|
||||
},
|
||||
matcher::MainMatcher,
|
||||
};
|
||||
use crate::util::{bin_name, env_var_present, quit_error_msg, ErrorHintsBuilder};
|
||||
|
@ -93,6 +96,18 @@ impl<'a: 'b, 'b> UploadMatcher<'a> {
|
|||
)
|
||||
}
|
||||
|
||||
/// Get the expiry time in seconds.
|
||||
///
|
||||
/// If the expiry time was not set, `None` is returned.
|
||||
pub fn expiry_time(
|
||||
&'a self,
|
||||
main_matcher: &MainMatcher,
|
||||
api_version: ApiVersion,
|
||||
auth: bool,
|
||||
) -> Option<usize> {
|
||||
ArgExpiryTime::value_checked(self.matches, main_matcher, api_version, auth)
|
||||
}
|
||||
|
||||
/// Check whether to archive the file to upload.
|
||||
#[cfg(feature = "archive")]
|
||||
pub fn archive(&self) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue