2020-03-07 07:50:04 +01:00
|
|
|
use crate::common::*;
|
|
|
|
|
2020-03-28 06:46:41 +01:00
|
|
|
mod completions;
|
2020-03-07 07:50:04 +01:00
|
|
|
mod torrent;
|
|
|
|
|
|
|
|
#[derive(StructOpt)]
|
|
|
|
pub(crate) enum Subcommand {
|
|
|
|
Torrent(torrent::Torrent),
|
2020-03-28 06:46:41 +01:00
|
|
|
Completions(completions::Completions),
|
2020-03-07 07:50:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Subcommand {
|
|
|
|
pub(crate) fn run(self, env: &mut Env, options: &Options) -> Result<(), Error> {
|
|
|
|
match self {
|
|
|
|
Self::Torrent(torrent) => torrent.run(env, options),
|
2020-03-28 06:46:41 +01:00
|
|
|
Self::Completions(completions) => completions.run(env),
|
2020-03-07 07:50:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|