Ejemplo n.º 1
0
    add_verbosity(parser, True)

    # Add difftype option
    add_difftype(parser, True)

    # Add the direction (changes-for)
    add_changes_for(parser)

    # Add show reverse option
    add_reverse(parser)

    # Add regexp
    add_regexp(parser)

    # Add ssl options
    add_ssl_options(parser)

    # Now we process the rest of the arguments.
    opt, args = parser.parse_args()

    # Fail if no db arguments or --all option.
    if len(args) == 0 and not opt.all:
        parser.error(PARSE_ERR_DB_MISSING_CMP)

    # Check security settings
    check_password_security(opt, args, "# ")

    # Warn if quiet and verbosity are both specified
    check_verbosity(opt)

    # Fail if the --all option and database arguments are both specified.
Ejemplo n.º 2
0
    )

    # Add start from beginning option
    parser.add_option(
        "-b",
        "--start-from-beginning",
        action="store_true",
        default=False,
        dest="from_beginning",
        help="start replication from the first event recorded "
        "in the binary logging of the master. Not valid "
        "with --master-log-file or --master-log-pos.",
    )

    # Add ssl options
    add_ssl_options(parser)

    # Add verbosity
    add_verbosity(parser)

    # Now we process the rest of the arguments.
    opt, args = parser.parse_args()

    # Check security settings
    check_password_security(opt, args)

    # option --master is required (mandatory)
    if not opt.master:
        default_val = "root@localhost:3306"
        print(WARN_OPT_USING_DEFAULT.format(default=default_val, opt="--master"))
        # Print the WARNING to force determinism if a parser error occurs.