-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added --depth and --short to sdf status for more concise summaries.
- New friendlier, concise status options. First, --depth merges statuses by a certain level of directory depth. Second, --short is --depth 2 plus an even more concise message per directory. - Fixed issue where file names were not being sorted lexicographically when displayed with sdf status. - Option --no-color added. - Time sorting (-t/--time) and reversed order (-r/--remote) added to sdf status. - Some refactor of code into src/lib/status.rs. - Fixed bug with total counts.
- Loading branch information
Showing
8 changed files
with
527 additions
and
171 deletions.
There are no files selected for viewing
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
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 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 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 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,47 @@ | ||
use clap::Parser; | ||
|
||
/// Status display options | ||
#[derive(Parser, Debug)] | ||
pub struct StatusDisplayOptions { | ||
/// Show remotes status (requires network). | ||
#[arg(short = 'm', long)] | ||
pub remotes: bool, | ||
|
||
/// Show statuses of all files, including those on remote(s) | ||
/// but not in the manifest. | ||
#[arg(short, long)] | ||
pub all: bool, | ||
|
||
/// Don't print status with terminal colors. | ||
#[arg(long)] | ||
pub no_color: bool, | ||
|
||
/// A more terse summary, with --depth 2. | ||
#[arg(short, long)] | ||
pub short: bool, | ||
|
||
/// Depth to summarize over. | ||
#[arg(short, long)] | ||
depth: Option<usize>, | ||
|
||
/// Sort by time, showing the most recently modified files at | ||
/// the top. | ||
#[arg(short, long)] | ||
pub time: bool, | ||
|
||
/// Reverse file order (if --time set, will show the files | ||
/// with the oldest modification time at the top; otherwise | ||
/// it will list files in reverse lexicographic order). | ||
#[arg(short, long)] | ||
pub reverse: bool, | ||
} | ||
|
||
impl StatusDisplayOptions { | ||
pub fn get_depth(&self) -> Option<usize> { | ||
if self.short { | ||
// --short includes | ||
return Some(2); | ||
} | ||
self.depth | ||
} | ||
} |
Oops, something went wrong.