docs: def parse_args():
      """
      Parse the command line arguments
      """
      parser = argparse.ArgumentParser(description = "Validate secrets using YubiHSM",
                                       add_help=True,
                                       formatter_class=argparse.ArgumentDefaultsHelpFormatter,
                                       )
      parser.add_argument('-D', '--device',
                          dest='device',
                          default=default_device,
                          required=False,
                          help='YubiHSM device',
                          )
      parser.add_argument('-U', '--serve-url',
                          dest='serve_url',
                          default=default_serve_url,
                          required=False,
                          help='Base URL for validation web service',
                          )
      parser.add_argument('-v', '--verbose',
                          dest='verbose',
                          action='store_true', default=False,
                          help='Enable verbose operation',
                          )
      parser.add_argument('--debug',
                          dest='debug',
                          action='store_true', default=False,
                          help='Enable debug operation',
                          )
      parser.add_argument('--port',
                          dest='listen_port',
                          type=int, default=8003,
                          required=False,
                          help='Port to listen on',
                          metavar='PORT',
                          )
      parser.add_argument('--addr',
                          dest='listen_addr',
                          default="127.0.0.1",
                          required=False,
                          help='Address to bind to',
                          metavar='ADDR',
                          )
      parser.add_argument('--hmac-kh',
                          dest='hmac_kh',
                          required=False, default=0,
                          help='Key handle to use for creating HMAC-SHA1 hashes',
                          metavar='KEY_HANDLE',
                          )
      parser.add_argument('--short-otp',
                          dest='mode_short_otp',
                          action='store_true', default=False,
                          help='Enable YubiKey OTP validation (KSM style response)',
                          )
      parser.add_argument('--otp',
                          dest='mode_otp',
                          action='store_true', default=False,
                          help='Enable YubiKey OTP validation 2.0',
                          )
      parser.add_argument('--hotp',
                          dest='mode_hotp',
                          action='store_true', default=False,
                          help='Enable OATH-HOTP validation',
                          )
      parser.add_argument('--totp',
                          dest='mode_totp',
                          action='store_true', default=False,
                          help='Enable OATH-TOTP validation',
                          )
      parser.add_argument('--pwhash',
                          dest='mode_pwhash',
                          action='store_true', default=False,
                          help='Enable password hash validation',
                          )
      parser.add_argument('--db-file',
                          dest='db_file',
                          default=default_db_file,
                          required=False,
                          help='DB file for storing AEAD\'s etc. for --pwhash and --hotp',
                          metavar='FILENAME',
                          )
      # XXX bad interaction with argparse.ArgumentDefaultsHelpFormatter here - we don't want to
      # use default=default_clients_file since we need to know if this option was specified explicitly
      # or not.
      parser.add_argument('--clients-file',
                          dest='clients_file',
                          default=None,
                          required=False,
                          help='File with OTP validation clients shared secrets. for --otp. Default : %s' % (default_clients_file),
                          metavar='FILENAME',
                          )
      parser.add_argument('--hotp-window',
                          dest='look_ahead',
                          type=int, required=False,
                          default = default_hotp_window,
                          help='Number of OATH-HOTP codes to search',
                          metavar='NUM',
                          )
      parser.add_argument('--totp-interval',
                          dest='interval',
                          type=int, required=False,
                          default = default_totp_interval,
                          help='Timeframe in seconds for a valid OATH-TOTP code',
                          metavar='NUM',
                          )
      parser.add_argument('--totp-tolerance',
                          dest='tolerance',
                          type=int, required=False,
                          default = default_totp_tolerance,
                          help='Tolerance in time-steps for a valid OATH-TOTP code',
                          metavar='NUM',
                          )
      parser.add_argument('--pid-file',
                          dest='pid_file',
                          default=default_pid_file,
                          required=False,
                          help='PID file',
                          metavar='FILENAME',
                          )
  
      return parser.parse_args()