Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-782

LP #1039074: Tools exit 0 on error parsing options, should exit non-zero

Details

    Description

      **Reported in Launchpad by Joe last update 16-11-2012 00:04:06

      According to the documentation of pt-table-checksum "the tools exit status is nonzero if any differences are found, or if any warnings or errors occur". However, if a bad command-line argument is passed the exit status is zero. This make it difficult to check for errors when executing via another script.

      Example:
      ./pt-table-checksum --foobar

      Output:
      Unknown option: foobar
      Usage: pt-table-checksum [OPTION...] [DSN]

      Errors in command-line arguments:

      • Error parsing options

      pt-table-checksum performs an online replication consistency check by executing
      checksum queries on the master, which produces different results on replicas
      that are inconsistent with the master. The optional DSN specifies the master
      host. The tool's exit status is nonzero if any differences are found, or if any
      warnings or errors occur. For more details, please use the --help option, or
      try 'perldoc ./pt-table-checksum'
      for complete documentation.

      Exit status will be 0.

      Version: pt-table-checksum 2.1.3

      Attachments

        Activity

          People

            Unassigned Unassigned
            lpjirasync lpjirasync (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Smart Checklist