diff options
Diffstat (limited to 'summain')
-rwxr-xr-x | summain | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -27,6 +27,8 @@ class Summain(cliapp.Application): def add_settings(self): self.settings.add_boolean_setting(['relative-paths', 'r'], 'print paths relative to arguments') + self.settings.add_boolean_setting(['mangle-paths', 'm'], + 'mangle (obfuscate) paths') def files(self, root): if os.path.isdir(root): @@ -39,10 +41,14 @@ class Summain(cliapp.Application): def process_args(self, args): relative = self.settings['relative-paths'] - normalizer = summainlib.NumberNormalizer() + nn = summainlib.NumberNormalizer() + if self.settings['mangle-paths']: + pn = summainlib.PathNormalizer() + else: + pn = summainlib.SamePath() for root in args: for filename in self.files(root): - o = summainlib.FilesystemObject(filename, normalizer) + o = summainlib.FilesystemObject(filename, nn, pn) self.output.write(o.format(root if relative else None)) self.output.write('\n') |