move QuestionPolicy to lib

This commit is contained in:
figsoda 2021-10-21 19:05:48 -04:00
parent 2816b837e2
commit d6054ba3ee
7 changed files with 10 additions and 10 deletions

View File

@ -11,7 +11,8 @@ use walkdir::WalkDir;
use crate::{
info,
utils::{self, Bytes, QuestionPolicy},
utils::{self, Bytes},
QuestionPolicy,
};
pub fn unpack_archive(

View File

@ -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;

View File

@ -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.

View File

@ -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

View File

@ -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;

View File

@ -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::*;

View File

@ -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);