# Copyright 2013-2015 Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Simpl's base module for its command line interface."""

from simpl.utils import cli as cli_utils


PARSER = cli_utils.HelpfulParser(
    prog='simpl',
    description='Build somthing awesome.',
)
SUBPARSER = PARSER.add_subparsers(
    title='commands',
    description='Available commands',
)


def default_parser():
    return PARSER


def default_subparser():
    return SUBPARSER


def main(argv=None):

    # the following code shouldn't need to change when
    # we add a new subcommand.
    args = default_parser().parse_args(argv)


if __name__ == '__main__':

    main()

@@ -639,16 +639,74 @@
 ce.%22%22%22%0A%0A
+import functools%0Aimport logging%0A%0Afrom simpl import server%0A
 from sim
@@ -1048,16 +1048,266 @@
 None):%0A%0A
+    #%0A    # %60simpl server%60%0A    #%0A    logging.basicConfig(level=logging.INFO)%0A    server_func = functools.partial(server.main, argv=argv)%0A    server_parser = server.attach_parser(default_subparser())%0A    server_parser.set_defaults(_func=server_func)%0A%0A
     # th
@@ -1384,16 +1384,16 @@
 ommand.%0A
-
     args
@@ -1429,16 +1429,33 @@
 s(argv)%0A
+    args._func()%0A
 %0A%0Aif __n

add 'server' subcommand