mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-01 03:00:13 -04:00
Added argparse to example_generator.py
This commit is contained in:
@@ -639,4 +639,16 @@ class Csharp(BaseParser):
|
||||
return 'using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {'
|
||||
|
||||
def footer(self):
|
||||
return '\n }\n }\n}'
|
||||
return '\n }\n }\n}'
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("language", help="The target language (Python, Java, Csharp, etc.)")
|
||||
parser.add_argument("destination", help="The path to the output file")
|
||||
args = parser.parse_args()
|
||||
writer = locals()[args.language]()
|
||||
writer.write(args.destination, writer.parse())
|
||||
print 'written to', args.destination
|
||||
Reference in New Issue
Block a user