diff --git a/downpour/app.py b/downpour/app.py index 05568b0..9bb76bf 100644 --- a/downpour/app.py +++ b/downpour/app.py @@ -59,31 +59,8 @@ def main(): config.register_argparse_arguments(parser, sys.argv, None) subparsers = parser.add_subparsers(title='commands') - do_export = subparsers.add_parser( - 'export', - help='export data', - ) - do_export.add_argument( - 'resource_file', - help='the name of the file listing resources to be exported', - ) - do_export.add_argument( - 'output_path', - default='.', - nargs='?', - help='the name of a directory to use for output file(s)', - ) - do_export.set_defaults(func=export.export_data) - - do_query = subparsers.add_parser( - 'query', - help='query to build an export list', - ) - do_query.add_argument( - 'resource_file', - help='the name of the file listing resources to be updated', - ) - do_query.set_defaults(func=query.query_data) + export.register_command(subparsers) + query.register_command(subparsers) args = parser.parse_args(sys.argv[1:]) diff --git a/downpour/export.py b/downpour/export.py index 67ca6c1..2f7e603 100644 --- a/downpour/export.py +++ b/downpour/export.py @@ -24,6 +24,24 @@ from downpour import resources LOG = logging.getLogger(__name__) +def register_command(subparsers): + do_export = subparsers.add_parser( + 'export', + help='export data', + ) + do_export.add_argument( + 'resource_file', + help='the name of the file listing resources to be exported', + ) + do_export.add_argument( + 'output_path', + default='.', + nargs='?', + help='the name of a directory to use for output file(s)', + ) + do_export.set_defaults(func=export_data) + + def export_data(cloud, config, args): output_path = args.output_path diff --git a/downpour/query.py b/downpour/query.py index 13ddb6f..db9642a 100644 --- a/downpour/query.py +++ b/downpour/query.py @@ -12,6 +12,24 @@ # License for the specific language governing permissions and limitations # under the License. +import logging + +import yaml + +LOG = logging.getLogger(__name__) + + +def register_command(subparsers): + do_query = subparsers.add_parser( + 'query', + help='query to build an export list', + ) + do_query.add_argument( + 'resource_file', + help='the name of the file listing resources to be updated', + ) + do_query.set_defaults(func=query_data) + def query_data(cloud, config, args): raise NotImplementedError('query not implemented')