-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
2 changed files
with
47 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,20 @@ | ||
using System.Diagnostics; | ||
|
||
static class Exts | ||
{ | ||
public static string Unix(this string it) { return it.ReplaceLineEndings("\n"); } | ||
public static string NoEOL(this string it) { return it.ReplaceLineEndings(" "); } | ||
public static void Z(this int it) { if (it != 0) throw new Exception("result not zero"); } | ||
|
||
public static string? GetFileNameOrDefault(this Process p) | ||
{ | ||
try | ||
{ | ||
return p.MainModule?.FileName; | ||
} | ||
catch | ||
{ | ||
return null; | ||
} | ||
} | ||
} |
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