Skip to content

Commit 9839b14

Browse files
authored
Merge pull request #256 from grovesNL/public-tool-family
RFC: expose tool family
2 parents 946c741 + 9966112 commit 9839b14

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,6 +1675,21 @@ impl Tool {
16751675
pub fn env(&self) -> &[(OsString, OsString)] {
16761676
&self.env
16771677
}
1678+
1679+
/// Whether the tool is GNU Compiler Collection-like.
1680+
pub fn is_like_gnu(&self) -> bool {
1681+
self.family == ToolFamily::Gnu
1682+
}
1683+
1684+
/// Whether the tool is Clang-like.
1685+
pub fn is_like_clang(&self) -> bool {
1686+
self.family == ToolFamily::Clang
1687+
}
1688+
1689+
/// Whether the tool is MSVC-like.
1690+
pub fn is_like_msvc(&self) -> bool {
1691+
self.family == ToolFamily::Msvc
1692+
}
16781693
}
16791694

16801695
fn run(cmd: &mut Command, program: &str) -> Result<(), Error> {

0 commit comments

Comments
 (0)