tas/src/main.rs

73 lines
2.1 KiB
Rust
Raw Normal View History

2022-08-05 14:11:24 +03:00
//! Copyright (C) 2022, Dmitriy Pleshevskiy <dmitriy@ideascup.me>
//!
//! tas is free software: you can redistribute it and/or modify
//! it under the terms of the GNU General Public License as published by
//! the Free Software Foundation, either version 3 of the License, or
//! (at your option) any later version.
//!
//! tas is distributed in the hope that it will be useful,
//! but WITHOUT ANY WARRANTY; without even the implied warranty of
//! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//! GNU General Public License for more details.
//!
//! You should have received a copy of the GNU General Public License
//! along with tas. If not, see <https://www.gnu.org/licenses/>.
//!
//---------------------------------------------------------------------
// Rustc lints
#![deny(
unused_imports,
unused_qualifications,
rust_2018_idioms,
unsafe_code,
non_ascii_idents
)]
// Clippy lints
#![deny(clippy::all)]
//---------------------------------------------------------------------
2022-08-05 00:08:27 +03:00
use clap::Parser;
use repo::fs::FsRepo;
2022-08-05 00:08:27 +03:00
use xdg::BaseDirectories;
mod cli;
pub mod domain;
pub mod repo;
2022-08-05 00:08:27 +03:00
fn main() {
let args = cli::Args::parse();
let xdg_dirs = BaseDirectories::with_prefix(env!("CARGO_PKG_NAME")).unwrap();
let repo = FsRepo::new(xdg_dirs);
2022-08-05 00:08:27 +03:00
match args.command {
2022-08-05 22:05:22 +03:00
cli::SubCommand::Add(args) => {
cli::add::execute(repo, args);
2022-08-05 00:08:27 +03:00
}
2022-08-05 21:57:34 +03:00
cli::SubCommand::Edit(args) => {
2022-08-16 15:43:44 +03:00
cli::edit::execute(repo, args);
2022-08-05 00:08:27 +03:00
}
2022-08-05 18:32:16 +03:00
cli::SubCommand::Remove(args) => {
2022-08-16 15:43:44 +03:00
cli::remove::execute(repo, args);
2022-08-05 00:08:27 +03:00
}
cli::SubCommand::List => {
2022-08-16 15:43:44 +03:00
cli::list::execute(repo);
2022-08-05 00:08:27 +03:00
}
2022-08-05 18:19:12 +03:00
cli::SubCommand::Priority(args) => {
2022-08-16 15:43:44 +03:00
cli::priority::execute(repo, args);
2022-08-05 18:19:12 +03:00
}
cli::SubCommand::Start(args) => {
2022-08-16 15:43:44 +03:00
cli::start::execute(repo, args);
2022-08-05 18:19:12 +03:00
}
cli::SubCommand::Pause => {
2022-08-16 15:43:44 +03:00
cli::pause::execute(repo);
2022-08-05 18:19:12 +03:00
}
cli::SubCommand::Finish(args) => {
cli::finish::execute(repo, args);
2022-08-05 18:19:12 +03:00
}
cli::SubCommand::Show(args) => {
cli::show::execute(repo, args);
2022-08-05 10:42:35 +03:00
}
2022-08-05 00:08:27 +03:00
}
}