mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 11:35:45 +00:00
Code cleanup
This commit is contained in:
parent
e080de860a
commit
095ade6621
@ -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
|
||||
|
@ -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)?
|
||||
{
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user