def _parse_arguments()

in scripts/ebcli_installer.py [0:0]


def _parse_arguments():
    """
    Function creates an `ArgumentParser`, parses arguments, and returns
    the parsed arguments.

    :return: an instance of argparse.Namespace representing the command-line
             arguments passed by the user.
    """
    parser = argparse.ArgumentParser(
        description='EBCLI installer {}\n\n'
                    'This program creates an isolated virtualenv solely meant for invoking '
                    '`eb` within.'.format(EBCLI_INSTALLER_VERSION),
        usage='python {file_name} [optional arguments]'.format(file_name=__file__),
        formatter_class=argparse.RawTextHelpFormatter
    )
    parser.add_argument(
        '-e', '--virtualenv-executable',
        help="path to the virtualenv installation to use to create the EBCLI's virtualenv"
    )
    parser.add_argument(
        '-i', '--hide-export-recommendation',
        action='store_true',
        help="boolean to hide recommendation to modify PATH"
    )
    parser.add_argument(
        '-l', '--location',
        help='location to store the awsebcli packages and its dependencies in'
    )
    parser.add_argument(
        '-p', '--python-installation',
        help='path to the python installation under which to install the '
             'awsebcli and its \ndependencies'
    )
    parser.add_argument(
        '-q', '--quiet',
        action='store_true',
        help='enable quiet mode to display only minimal, necessary output'
    )
    parser.add_argument(
        '-s', '--ebcli-source',
        help='filesystem path to a Git repository of the EBCLI, or a .zip or .tar file of \n'
             'the EBCLI source code; useful when testing a development version of the EBCLI.'
    )
    parser.add_argument(
        '-v', '--version',
        help='version of EBCLI to install'
    )

    arguments = parser.parse_args()

    if arguments.version and arguments.ebcli_source:
        raise ArgumentError(
            '"--version" and "--ebcli-source" cannot be used together '
            'because they represent two distinct sources of the EBCLI.'
        )
    return arguments