code: def detect_command(cmdlist):
      '''Detect available clipboard util and return cmdline to copy data to the system clipboard.
      cmddict is list of (platform, progname, argstr).'''
  
      for platform, command, args in cmdlist:
          if platform is None or sys.platform == platform:
              path = shutil.which(command)
              if path:
                  return ' '.join([path, args])
  
      return 'f detect_command(cmdlist):
      '''Detect available clipboard util and return cmdline to copy data to the system clipboard.
      cmddict is list of (platform, progname, argstr).'''
  
      for platform, command, args in cmdlist:
          if platform is None or sys.platform == platform:
              path = shutil.which(command)
              if path:
                  return ' '.join([path, args])
  
      return ''
docs: Detect available clipboard util and return cmdline to copy data to the system clipboard.
      cmddict is list of (platform, progname, argstr).