Code cleanup

This commit is contained in:
Vinícius Miguel 2021-04-06 03:37:49 -03:00
parent e080de860a
commit 095ade6621
3 changed files with 2 additions and 8 deletions

View File

@ -2,8 +2,6 @@ use std::{env, ffi::OsString, io, path::PathBuf, vec::Vec};
use oof::{arg_flag, flag};
use crate::debug;
pub const VERSION: &str = "0.1.5";
#[derive(PartialEq, Eq, Debug)]
@ -87,11 +85,9 @@ pub fn parse_args_from(mut args: Vec<OsString>) -> crate::Result<ParsedArgs> {
// Defaults to decompression when there is no subcommand
None => {
flags_info.push(arg_flag!('o', "output"));
debug!(&flags_info);
// Parse flags
let (args, mut flags) = oof::filter_flags(args, &flags_info)?;
debug!((&args, &flags));
let files: Vec<_> = args.into_iter().map(PathBuf::from).collect();
// TODO: This line doesn't seem to be working correctly

View File

@ -176,7 +176,6 @@ impl Evaluator {
let confirm = Confirmation::new("Do you want to overwrite 'FILE'?", Some("FILE"));
let (first_compressor, second_compressor) = Self::get_compressor(&output)?;
// TODO: use -y and -n here
if output_path.exists()
&& !utils::permission_for_overwriting(&output_path, flags, &confirm)?
{

View File

@ -23,7 +23,6 @@ fn main() {
}
fn run() -> crate::Result<()> {
let ParsedArgs { command, flags } = cli::parse_args()?;
debug!(&command);
let ParsedArgs { command, flags } = cli::parse_args()?;
Evaluator::evaluate(command, &flags)
}