#!/usr/bin/env python

#    Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at
#
#        http://aws.amazon.com/apache2.0/
#
#    or in the "license" file accompanying this file. This file 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.

import argparse
from rdk import rdk

if __name__ == "__main__":
    #Set up command-line argument parser.
    parser = argparse.ArgumentParser(description='CLI for authoring, deploying, and testing custom AWS Config rules.')
    parser.add_argument('--profile','-p', help="[optional] indicate which Profile to use.")
    parser.add_argument('--access-key','-k', help="[optional] Access Key ID to use.")
    parser.add_argument('--secret-access-key', '-s', help="[optional] Secret Access Key to use.")
    parser.add_argument('--region','-r', help='Select the region to run against.')
    parser.add_argument('--verbose','-v', action='count')
    #Removed for now from command choices: 'test-remote', 'status'
    parser.add_argument('command', metavar='<command>', help='Command to run.', choices=['init', 'create', 'modify', 'deploy', 'test-local', 'sample-ci', 'logs'])
    parser.add_argument('command_args', metavar='<command arguments>', nargs=argparse.REMAINDER)

    args = parser.parse_args()

    my_rdk = rdk.rdk(args)
    return_val = my_rdk.process_command()
    exit(return_val)
