mirror of
https://github.com/timvisee/ffsend.git
synced 2025-10-04 01:59:14 +02:00
Add version subcommand to determine remote server API version
This commit is contained in:
parent
7c1429e112
commit
f53f11a9f1
9 changed files with 143 additions and 4 deletions
|
@ -6,12 +6,13 @@ use clap::{App, AppSettings, Arg, ArgMatches};
|
|||
use super::matcher::HistoryMatcher;
|
||||
use super::matcher::{
|
||||
DebugMatcher, DeleteMatcher, DownloadMatcher, ExistsMatcher, InfoMatcher, Matcher,
|
||||
ParamsMatcher, PasswordMatcher, UploadMatcher,
|
||||
ParamsMatcher, PasswordMatcher, UploadMatcher, VersionMatcher,
|
||||
};
|
||||
#[cfg(feature = "history")]
|
||||
use super::subcmd::CmdHistory;
|
||||
use super::subcmd::{
|
||||
CmdDebug, CmdDelete, CmdDownload, CmdExists, CmdInfo, CmdParams, CmdPassword, CmdUpload,
|
||||
CmdVersion,
|
||||
};
|
||||
use crate::config::{CLIENT_TIMEOUT, CLIENT_TRANSFER_TIMEOUT};
|
||||
#[cfg(feature = "history")]
|
||||
|
@ -145,7 +146,8 @@ impl<'a: 'b, 'b> Handler<'a> {
|
|||
.subcommand(CmdInfo::build())
|
||||
.subcommand(CmdParams::build())
|
||||
.subcommand(CmdPassword::build())
|
||||
.subcommand(CmdUpload::build().display_order(1));
|
||||
.subcommand(CmdUpload::build().display_order(1))
|
||||
.subcommand(CmdVersion::build());
|
||||
|
||||
// With history support, a flag for the history file and incognito mode
|
||||
#[cfg(feature = "history")]
|
||||
|
@ -239,4 +241,9 @@ impl<'a: 'b, 'b> Handler<'a> {
|
|||
pub fn upload(&'a self) -> Option<UploadMatcher> {
|
||||
UploadMatcher::with(&self.matches)
|
||||
}
|
||||
|
||||
/// Get the version sub command, if matched.
|
||||
pub fn version(&'a self) -> Option<VersionMatcher> {
|
||||
VersionMatcher::with(&self.matches)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue