mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 11:35:45 +00:00
move QuestionPolicy to lib
This commit is contained in:
parent
2816b837e2
commit
d6054ba3ee
@ -11,7 +11,8 @@ use walkdir::WalkDir;
|
||||
|
||||
use crate::{
|
||||
info,
|
||||
utils::{self, Bytes, QuestionPolicy},
|
||||
utils::{self, Bytes},
|
||||
QuestionPolicy,
|
||||
};
|
||||
|
||||
pub fn unpack_archive(
|
||||
|
@ -11,7 +11,8 @@ use zip::{self, read::ZipFile, ZipArchive};
|
||||
|
||||
use crate::{
|
||||
info,
|
||||
utils::{self, dir_is_empty, strip_cur_dir, Bytes, QuestionPolicy},
|
||||
utils::{self, dir_is_empty, strip_cur_dir, Bytes},
|
||||
QuestionPolicy,
|
||||
};
|
||||
|
||||
use self::utf8::get_invalid_utf8_paths;
|
||||
|
@ -7,8 +7,7 @@ use std::{
|
||||
|
||||
use clap::Parser;
|
||||
|
||||
pub use crate::utils::QuestionPolicy;
|
||||
use crate::{Error, Opts, Subcommand};
|
||||
use crate::{Error, Opts, QuestionPolicy, Subcommand};
|
||||
|
||||
impl Opts {
|
||||
/// A helper method that calls `clap::Parser::parse` and then translates relative paths to absolute.
|
||||
|
@ -18,10 +18,8 @@ use crate::{
|
||||
CompressionFormat::{self, *},
|
||||
},
|
||||
info,
|
||||
utils::nice_directory_display,
|
||||
utils::to_utf,
|
||||
utils::{self, dir_is_empty, QuestionPolicy},
|
||||
Error, Opts, Subcommand,
|
||||
utils::{self, dir_is_empty, nice_directory_display, to_utf},
|
||||
Error, Opts, QuestionPolicy, Subcommand,
|
||||
};
|
||||
|
||||
// Used in BufReader and BufWriter to perform less syscalls
|
||||
|
@ -19,6 +19,7 @@ mod utils;
|
||||
|
||||
pub use error::{Error, Result};
|
||||
pub use opts::{Opts, Subcommand};
|
||||
pub use utils::QuestionPolicy;
|
||||
|
||||
/// The status code ouch has when an error is encountered
|
||||
pub const EXIT_FAILURE: i32 = libc::EXIT_FAILURE;
|
||||
|
@ -7,7 +7,7 @@ use std::{
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use ouch::{cli::QuestionPolicy, commands::run, Opts, Subcommand};
|
||||
use ouch::{commands::run, Opts, QuestionPolicy, Subcommand};
|
||||
use rand::{rngs::SmallRng, RngCore, SeedableRng};
|
||||
use tempfile::NamedTempFile;
|
||||
use utils::*;
|
||||
|
@ -7,7 +7,7 @@ use std::{
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use ouch::{cli::QuestionPolicy, commands::run, Opts, Subcommand};
|
||||
use ouch::{commands::run, Opts, QuestionPolicy, Subcommand};
|
||||
|
||||
pub fn create_empty_dir(at: &Path, filename: &str) -> PathBuf {
|
||||
let dirname = Path::new(filename);
|
||||
|
Loading…
x
Reference in New Issue
Block a user