[PATCH] D34711: [opt-viewer] opt-viewer.py takes -o argument

Brian Gesiak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 14:00:05 PDT 2017


modocache created this revision.
Herald added a subscriber: fhahn.

Change how the output directory is specified when invoking
opt-viewer.py, from `opt-viewer.py yaml_file_one yaml_file_two output_dir` to
`opt-viewer.py -o output_dir yaml_file_one yaml_file_two`.

This makes it easier to pipe the results of another command into
opt-viewer.py. For example:

  find . -name "*.yaml" -print | xargs /path/to/opt-viewer.py -o html


https://reviews.llvm.org/D34711

Files:
  utils/opt-viewer/opt-viewer.py


Index: utils/opt-viewer/opt-viewer.py
===================================================================
--- utils/opt-viewer/opt-viewer.py
+++ utils/opt-viewer/opt-viewer.py
@@ -202,7 +202,13 @@
 if __name__ == '__main__':
     parser = argparse.ArgumentParser(description=desc)
     parser.add_argument('yaml_files', nargs='+')
-    parser.add_argument('output_dir')
+    parser.add_argument(
+        '--output-dir',
+        '-o',
+        default='html',
+        help='Path to a directory where generated HTML files will be output. '
+             'If the directory does not already exist, it will be created. '
+             '"%(default)s" by default.')
     parser.add_argument(
         '--jobs',
         '-j',


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34711.104267.patch
Type: text/x-patch
Size: 722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170627/b6e1f1ae/attachment.bin>


More information about the llvm-commits mailing list