-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
393baea
commit 1b5b2b0
Showing
87 changed files
with
200 additions
and
6,664 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use crate::error::{self, ErrorReport, Result, WithContext}; | ||
use clap::Parser; | ||
use std::{env, path::PathBuf}; | ||
|
||
#[derive(Parser, Debug)] | ||
#[command(name = "erdtree")] | ||
#[command(author = "Benjamin Nguyen. <[email protected]>")] | ||
#[command(version = "4.0.0")] | ||
#[command( | ||
about = "erdtree (erd) is a cross-platform, multi-threaded, and general purpose filesystem and disk usage utility.", | ||
long_about = None, | ||
)] | ||
pub struct Args { | ||
/// Directory to traverse; defaults to current working directory | ||
dir: Option<PathBuf>, | ||
} | ||
|
||
impl Args { | ||
pub fn init() -> Result<Self> { | ||
let mut clargs = Self::parse(); | ||
clargs.set_dir()?; | ||
Ok(clargs) | ||
} | ||
|
||
fn set_dir(&mut self) -> Result<()> { | ||
let current_dir = env::current_dir().into_report(error::Category::System)?; | ||
|
||
Err(std::io::Error::new( | ||
std::io::ErrorKind::Other, | ||
"This is the underlying error", | ||
)) | ||
.into_report(error::Category::User) | ||
.context("Oh my god...") | ||
.context("Look at her butt") | ||
.context("omg..")?; | ||
|
||
//.into_report_ctx(error::Category::Internal, "hmmmm")?; | ||
|
||
Ok(()) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.