Skip to content

Commit

Permalink
Merge pull request ned14#75 from assarbad/changed-main-logic-pcmd
Browse files Browse the repository at this point in the history
Rearranging how main() works (ned14#73)
  • Loading branch information
ned14 authored Nov 18, 2022
2 parents 2ad25f1 + 62658ba commit a75d642
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pcpp/pcmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,11 @@ def on_comment(self,tok):
return True # Pass through
return super(CmdPreprocessor, self).on_comment(tok)

def main():
p = CmdPreprocessor(sys.argv)
sys.exit(p.return_code)
def main(argv=None):
if argv is None:
argv = sys.argv
p = CmdPreprocessor(argv)
return p.return_code

if __name__ == "__main__":
p = CmdPreprocessor(sys.argv)
sys.exit(p.return_code)
sys.exit(main(sys.argv))

0 comments on commit a75d642

Please sign in to comment.