[PATCH] D56565: gn build: Add gn.py wrapper script that adds appropriate --dotfile= and --root= paramers

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 12 04:05:56 PST 2019


thakis added inline comments.


================
Comment at: llvm/utils/gn/gn.py:25
+    extra_args = []
+    if 'help' not in sys.argv:  # `gn help` gets confused by the switches.
+        cwd = os.getcwd()
----------------
phosek wrote:
> Shouldn't we check if `help` is the first argument (i.e. `argv[1]`)? Otherwise this would catch even cases like `gn gen help` (which is admittedly a strange name for output directory but nevertheless valid).
I think either check will have false positives (e.g. ` gn --nocolor help gen` doesn't work when checking argv[1]). It's not _that_ much code to get the first non-flag arg, so I did that.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56565/new/

https://reviews.llvm.org/D56565





More information about the llvm-commits mailing list