Default values are defined here.

def handle_args():
    """
    Default values are defined here.
    """

    default_database_name = os.environ.get(
        'VOEVENTDB_DBNAME',
        dbconfig.testdb_corpus_url.database)
    default_logfile_path = os.path.expanduser("~/voeventdb_packet_ingest.log")

    parser = argparse.ArgumentParser(
        prog=os.path.basename(__file__),
        formatter_class=argparse.ArgumentDefaultsHelpFormatter, )

    parser.description = """
    Ingest a packet from stdin and attempt to ingest into a voeventdb database.

    Usage:

      cat test.xml | voeventdb_ingest_packet.py -d mydb -l /tmp/my.log

    """

    parser.add_argument('-d', '--dbname', nargs='?',
                        default=str(default_database_name),
                        help='Database name')

    parser.add_argument('-l', '--logfile_path', nargs='?',
                        default=default_logfile_path,
                        )
    return parser.parse_args()