Last active
May 14, 2017 01:42
-
-
Save xinhaoyuan/da62936432f7296613053d862e3abaec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from six.moves import range | |
import alist | |
import sys | |
def main(param): | |
print(param) | |
if __name__ == '__main__': | |
parser = alist.AListParser() | |
parser.parse_line('[') | |
for i in range(1, len(sys.argv)): | |
try: | |
parser.parse_line(sys.argv[i]) | |
except alist.ParseException as e: | |
raise Exception('Error while parsing command line arg {0}: {1}'.format(i, e)) | |
try: | |
parser.parse_line(']') | |
except alist.ParseException as e: | |
raise Exception('Error while parsing eof-of-args: {0}'.format(e)) | |
main(parser.extract()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment