"""
ClipperCard Client

Usage:
  clippercard (-h | --version)
  clippercard summary {auth_args}

Options:
  -h --help             Show this screen.
  -v --version          Show version.
  --account=<acct>      Optional, account section name in ~/.godaddyrc config [Default: default].
  --config=<cfg>        Optional, account login config file path [Default: ~/.clippercardrc].
  --username=<user>     Optional, GoDaddy login username if not using config file.
  --password=<pass>     Optional, GoDaddy login password if not using config file.
"""

__doc__ = __doc__.format(
    auth_args='([--account=<acct>] [--config=<cfg>] | [ (--username=<user> --password=<pass>) ])'
    )

import clippercard
import configparser
import docopt
import os.path
import sys


class ClipperCardCommandError(Exception):
    pass


def _get_client_auth(args):
    """
    Finds/parses the username and password from either the args or a config file.

    :returns: a tuple of (username, password)
    """
    username, password = args['--username'], args['--password']
    if not (username and password):
        config_file_path = os.path.expanduser(args['--config'])
        if not os.path.exists(config_file_path):
            raise ClipperCardCommandError('Login config file {0} does not exist.'.format(
                config_file_path
                ))
        try:
            parser = configparser.SafeConfigParser()
            parser.read(config_file_path)
            section = args['--account']
            username, password = parser.get(section, 'username'), parser.get(section, 'password')
        except configparser.NoSectionError:
            raise ClipperCardCommandError('Account config section {0} is not found in {1}'.format(
                repr(args['--account']),
                config_file_path
                ))
    return username, password


def main():
    args = docopt.docopt(__doc__, version=clippercard.__version__)
    if args['--version']:
        print(clippercard.__version__)
        sys.exit(0)

    try:
        username, password = _get_client_auth(args)
        session = clippercard.Session(username, password)
        if args['summary']:
            print(session.get_summary())
    except (clippercard.client.ClipperCardError, ClipperCardCommandError) as e:
        sys.exit(e.message)


if __name__ == '__main__':
    main()

@@ -244,15 +244,19 @@
  ~/.
-godaddy
+clippercard
 rc c
@@ -404,32 +404,24 @@
    Optional,
- GoDaddy
  login usern
@@ -487,16 +487,8 @@
 nal,
- GoDaddy
  log

help text fix: godaddy reference copy pasta