From 2d3e8e673c49bcfec0446dbee90460c93968cecb Mon Sep 17 00:00:00 2001 From: Adam Waldenberg Date: Sat, 5 May 2012 10:26:02 +0200 Subject: [PATCH] Completely removed the -x option controlling printing of escape characters. Instead, gitinspector now probes stdout and checks if it points to a proper terminal. If it doesn't, escape characters are skipped. --- gitinspector.py | 7 ++----- help.py | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/gitinspector.py b/gitinspector.py index 1c2681b..b9ea046 100755 --- a/gitinspector.py +++ b/gitinspector.py @@ -33,13 +33,12 @@ class Runner: self.hard = False self.list_file_types = False self.repo = "." - self.skipescapes = False self.tda367 = False self.timeline = False self.useweeks = False def output(self): - terminal.skip_escapes(self.skipescapes) + terminal.skip_escapes(not sys.stdout.isatty()) changes.output(self.repo, self.hard) if changes.get(self.repo, self.hard).get_commits(): @@ -59,7 +58,7 @@ if __name__ == "__main__": __run__ = Runner() try: - __opts__, __args__ = getopt.gnu_getopt(sys.argv[1:], "f:hHlTwx", ["file-types=", "hard", "help", + __opts__, __args__ = getopt.gnu_getopt(sys.argv[1:], "f:hHlTw", ["file-types=", "hard", "help", "list-file-types", "tda367", "timeline", "version"]) except getopt.error, msg: print sys.argv[0], "\b:", msg @@ -87,8 +86,6 @@ if __name__ == "__main__": __run__.timeline = True elif o in("-w"): __run__.useweeks = True - elif o in("-x"): - __run__.skipescapes = True for arg in __args__: __run__.repo = arg diff --git a/help.py b/help.py index 4e30401..d695af0 100644 --- a/help.py +++ b/help.py @@ -38,7 +38,6 @@ Mandatory arguments to long options are mandatory for short options too. for things such as documentation (RAD/SDD) -w show all statistical information in weeks instead of in months - -x skip printing of escape characters -h, --help display this help and exit --version output version information and exit