From 0883216e0f15116a8f427ce2a711c510e6f31ed9 Mon Sep 17 00:00:00 2001 From: Paul Makepeace Date: Wed, 8 Jun 2011 17:07:39 +0000 Subject: [PATCH] Allow no options or args and just print usage. Return project so it's available with python -i refine.py --- refine.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/refine.py b/refine.py index 7a5482c..ffc832b 100755 --- a/refine.py +++ b/refine.py @@ -83,10 +83,10 @@ def main(): refine.REFINE_PORT = options.port if not options.list and len(args) != 1: - PARSER.error('expecting --list or project ID/URL') + PARSER.print_usage() if options.list: list_projects() - else: + if args: project = refine.RefineProject(args[0]) if options.apply: response = project.apply_operations(options.apply) @@ -96,6 +96,8 @@ def main(): if options.export: export_project(project, options) + return project if __name__ == '__main__': - main() + # return project so that it's available interactively, python -i refine.py + project = main()