pub fn new_with_dir<T>(arguments: ArgMatches, dir: T) -> Context
    where
        T: Into<PathBuf>,
    {
        let config = toml::value::Table::initialize();

        // TODO: Currently gets the physical directory. Get the logical directory.
        let current_dir = Context::expand_tilde(dir.into());

        let dir_files = fs::read_dir(&current_dir)
            .unwrap_or_else(|_| {
                panic!(
                    "Unable to read current directory: {}",
                    current_dir.to_string_lossy()
                )
            })
            .filter_map(Result::ok)
            .map(|entry| entry.path())
            .collect::<Vec<PathBuf>>();

        Context {
            config,
            arguments,
            current_dir,
            dir_files,
            repo: OnceCell::new(),
        }
    }
/// Create a new instance of Context for the provided directory
Create a new instance of Context for the provided directory
Create a new instance of Context for the provided directory
pub fn new_with_dir<T>(arguments: ArgMatches, dir: T) -> Context
    where
        T: Into<PathBuf>,
    {
        let config = toml::value::Table::initialize();
        // TODO: Currently gets the physical directory. Get the logical directory.
        let current_dir = Context::expand_tilde(dir.into());
        let dir_files = fs::read_dir(&current_dir)
            .unwrap_or_else(|_| {
                panic!(
                    "Unable to read current directory: {}",
                    current_dir.to_string_lossy()
                )
            })
            .filter_map(Result::ok)
            .map(|entry| entry.path())
            .collect::<Vec<PathBuf>>();
        Context {
            config,
            arguments,
            current_dir,
            dir_files,
            repo: OnceCell::new(),
        }
    }
pub fn new_with_dir < T > ( arguments : ArgMatches , dir : T ) -> Context where T : Into < PathBuf > , { let config = toml :: value :: Table :: initialize ( ) ; // TODO: Currently gets the physical directory. Get the logical directory. let current_dir = Context :: expand_tilde ( dir . into ( ) ) ; let dir_files = fs :: read_dir ( & current_dir ) . unwrap_or_else ( | _ | { panic ! ( " " current_dir to_string_lossy ( ) ) } ) . filter_map ( Result :: ok ) . map ( | entry | entry . path ( ) ) . collect :: < Vec < PathBuf > > ( ) ; Context { config , arguments , current_dir , dir_files , repo : OnceCell :: new ( ) , } }
Create a new instance of Context for the provided directory
Create a new instance of Context for the provided directory
arguments
ArgMatches
dir
T