-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add grandiloquent verbosity level that echos shebang recipes (#348)
- Loading branch information
Showing
6 changed files
with
54 additions
and
10 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
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
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,34 @@ | ||
use Verbosity::*; | ||
|
||
#[derive(Copy, Clone)] | ||
pub enum Verbosity { | ||
Taciturn, | ||
Loquacious, | ||
Grandiloquent, | ||
} | ||
|
||
impl Verbosity { | ||
pub fn from_flag_occurrences(flag_occurences: u64) -> Verbosity { | ||
match flag_occurences { | ||
0 => Taciturn, | ||
1 => Loquacious, | ||
_ => Grandiloquent, | ||
} | ||
} | ||
|
||
pub fn loquacious(self) -> bool { | ||
match self { | ||
Taciturn => false, | ||
Loquacious => true, | ||
Grandiloquent => true, | ||
} | ||
} | ||
|
||
pub fn grandiloquent(self) -> bool { | ||
match self { | ||
Taciturn => false, | ||
Loquacious => false, | ||
Grandiloquent => true, | ||
} | ||
} | ||
} |