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