Exemple #1
0
# Option to write command to file
parser.add_option("--write-command",
                  "-w",
                  action="store",
                  dest='cmd_file',
                  default=None,
                  type="string",
                  help="path to file for writing"
                  " startup command. For example: start_server1.sh")

# Add verbosity and quiet mode
add_verbosity(parser, True)

# Add --basedir option
add_basedir_option(parser)

# Add --delete-data
parser.add_option("--delete-data",
                  action="store_true",
                  dest="delete",
                  help="delete the folder specified by --new-data if it "
                  "exists and is not empty.")

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

# Check the basedir option for errors (e.g., invalid path)
check_basedir_option(parser, opt.basedir)

# Can only use --basedir and --datadir if --server is missing
                  type="string", help="password for the root user")

# Optional additional command-line options
parser.add_option("--mysqld", action="store", dest="mysqld",
                  type="string", help="additional options for mysqld")

# Option to write command to file
parser.add_option("--write-command", "-w", action="store", dest='cmd_file',
                  default=None, type="string", help="path to file for writing"
                  " startup command. For example: start_server1.sh")

# Add verbosity and quiet mode
add_verbosity(parser, True)

# Add --basedir option
add_basedir_option(parser)

# Add --delete-data
parser.add_option("--delete-data", action="store_true", dest="delete",
                  help="delete the folder specified by --new-data if it "
                  "exists and is not empty.")

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

# Check the basedir option for errors (e.g., invalid path)
check_basedir_option(parser, opt.basedir)

# Can only use --basedir and --datadir if --server is missing
if opt.basedir is not None and opt.server is not None:
    parser.error("Cannot use the --basedir and --server options together.")