Matteo Bertini avatar Matteo Bertini committed 22dd1cc

Read comments from all the lines

Comments (0)

Files changed (1)

                            tuple(sorted(self.commands)),
                           ))
     def _parse_options(self):
-        args, others = self.parser.parse_known_args(" ".join([self.comment] + self.commands).split())
+        args, others = self.parser.parse_known_args(" ".join([self.comment]).split())
         if args.MKTARGETS is not None:
             args.INPLACE = args.CHECKEXISTS = args.MKTARGETS
         self._inplace = set(self.targets if (args.INPLACE == []) else (args.INPLACE or []))
         lines = iter(lines)
         c = 0
         for line in lines:
+            comment = []
             try:
                 c += 1
                 if line.find("#") > 0:
-                    line, comment = (l.strip() for l in line.split("#", 1))
-                else:
-                    comment = ""
+                    line, _comment = (l.strip() for l in line.split("#", 1))
+                    if _comment:
+                        comment += [_comment]
                 if not line:
                     continue
                 if ":" in line:
                     deps = dict((i.strip(), None) for i in deps.split())
                     #TODO: add support for multiline command
                     commands = [lines.next().strip()]
+                    comment = " ".join(comment)
                     yield BaseTask(targets, deps, comment, commands, c)
                     c += 1
             except:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.