2022-09-26 19:54:39 +00:00
|
|
|
/*
|
|
|
|
* Vento, a CLI inventory for your files.
|
|
|
|
* Copyright (C) 2022 Lux Aliaga
|
|
|
|
*
|
|
|
|
* This program 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.
|
|
|
|
*
|
|
|
|
* This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2023-02-10 00:30:09 +00:00
|
|
|
use anyhow::Result;
|
2023-08-21 17:34:01 +00:00
|
|
|
use clap::Parser;
|
|
|
|
use vento::{common::override_color, item};
|
|
|
|
|
|
|
|
#[derive(Parser)]
|
|
|
|
#[command(name = "Take")]
|
|
|
|
#[command(about = "A file grabber for Vento", long_about = None)]
|
|
|
|
#[command(author, version)]
|
|
|
|
struct Cli {
|
|
|
|
/// Pick a slot to take the file into
|
|
|
|
#[arg(short, long)]
|
|
|
|
slot: Option<String>,
|
|
|
|
|
|
|
|
/// File to take
|
|
|
|
file: String,
|
|
|
|
}
|
2022-09-26 19:54:39 +00:00
|
|
|
|
|
|
|
fn main() -> Result<()> {
|
2022-09-27 23:05:08 +00:00
|
|
|
// Handles args in Vento
|
2023-08-20 00:26:28 +00:00
|
|
|
override_color()?;
|
2023-08-21 17:34:01 +00:00
|
|
|
let cli = Cli::parse();
|
|
|
|
let slot = cli.slot.unwrap_or(String::from("active"));
|
|
|
|
|
|
|
|
item::take(&cli.file, &slot, true)?;
|
2022-09-26 19:54:39 +00:00
|
|
|
Ok(())
|
|
|
|
}
|