Skip to content

Instantly share code, notes, and snippets.

@mikale
Created June 8, 2011 06:46
Show Gist options
  • Select an option

  • Save mikale/1013912 to your computer and use it in GitHub Desktop.

Select an option

Save mikale/1013912 to your computer and use it in GitHub Desktop.
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "ht:", ["help" ])
except getopt.GetoptError, err:
raise UseError()
if not len(args):
raise UseError()
try:
pathtype = int(opts["-t"])
if pathtye not in (1,2,3):
raise Usererror('is not 1,2,3')
excpet KeyError,err:
raise UseError()
for path in args:
process_path(path,pathtype)
if __name__ == "__main__":
try:
main()
excpet UserError,err
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment