def arg_parser():
    
    # This is the main parser that the script entry point uses.
    main_parser = argparse.ArgumentParser(
        description="cassback - snap, slurp, purge", 
        formatter_class=argparse.ArgumentDefaultsHelpFormatter, 
        fromfile_prefix_chars="@")
    
    # say we have sub commands
    sub_parsers = main_parser.add_subparsers(title="Commands", 
        description="Commands to help you snap, slurp, purge.")

    # Start adding sub commands
    # use set_default() to specify a function to call for each sub command.

    # Global / static sub commands
    # Show help for a sub command.
    parser = sub_parsers.add_parser("help", help="Get help.")
    parser.set_defaults(func=execute_help)
    parser.add_argument('command', type=str, default="", nargs="?",
        help='Command to print help for.')
    
    for entry_point in pkg_resources.iter_entry_points(
        "cassback.sub_commands"):
        
        # Load the class and add it's parser
        entry_point.load().add_sub_parser(sub_parsers)

    endpoint_names = []
    # Add all of the endpoints
    for entry_point in pkg_resources.iter_entry_points("cassback.endpoints"):
        
        # Load the class and add it's parser
        endpoint_class = entry_point.load()
        endpoint_class.add_arg_group(main_parser)
        endpoint_names.append(endpoint_class.name)

    # Global Configuration
    main_parser.add_argument("--endpoint", default="local", 
        choices=endpoint_names, 
        help="Name of the endpoint to use for backup and restore.")

    main_parser.add_argument("--cassandra-version", default="1.2.0", 
        dest="cassandra_version", 
        help="Cassandra version to backup from or restore to.")

    main_parser.add_argument("--log-level", default="INFO", 
        dest="log_level", 
        choices=["FATAL", "CRITICAL", "ERROR", "WARN", "INFO", "DEBUG"],
        help="Logging level.")
    main_parser.add_argument("--log-file", 
        default="/var/log/cassback/cassback.log", 
        dest="log_file", 
        help="Logging file.")

    return main_parser
Builds wrapper for adding comment to description text.
dataset/ETHPy150Open amorton/cassback/cassback/scripts.py/arg_parser--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/ht.py/Comment