Allow no options or args and just print usage. Return project so it's available with python -i refine.py
This commit is contained in:
parent
dfcf5e8978
commit
0883216e0f
|
@ -83,10 +83,10 @@ def main():
|
||||||
refine.REFINE_PORT = options.port
|
refine.REFINE_PORT = options.port
|
||||||
|
|
||||||
if not options.list and len(args) != 1:
|
if not options.list and len(args) != 1:
|
||||||
PARSER.error('expecting --list or project ID/URL')
|
PARSER.print_usage()
|
||||||
if options.list:
|
if options.list:
|
||||||
list_projects()
|
list_projects()
|
||||||
else:
|
if args:
|
||||||
project = refine.RefineProject(args[0])
|
project = refine.RefineProject(args[0])
|
||||||
if options.apply:
|
if options.apply:
|
||||||
response = project.apply_operations(options.apply)
|
response = project.apply_operations(options.apply)
|
||||||
|
@ -96,6 +96,8 @@ def main():
|
||||||
if options.export:
|
if options.export:
|
||||||
export_project(project, options)
|
export_project(project, options)
|
||||||
|
|
||||||
|
return project
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
# return project so that it's available interactively, python -i refine.py
|
||||||
|
project = main()
|
||||||
|
|
Loading…
Reference in New Issue