docs: def _main():
      """ CLI interface """
      import sys
  
      if len(sys.argv) < 2:
          _usage('Expected at least one parameter!')
  
      sc = sys.argv[1]
      options = sys.argv[2:]
      if sc == 'a' or sc == 'advertise':
          if len(options) > 5 or len(options) < 2:
              _usage()
  
          stype,port = options[:2]
          advertisername = options[2] if len(options) > 2 else None
          sname = options[3] if len(options) > 3 else ''
          slocation = options[4] if len(options) > 4 else ''
  
          service = Service(stype, port, sname, slocation)
          advertiser = Advertiser([service], advertisername)
          advertiser.run()
      elif sc == 's' or sc == 'seek':
          if len(options) > 4:
              _usage()
  
          aname = options[0] if len(options) > 0 else ''
          stype = options[1] if len(options) > 1 else ''
          sname = options[2] if len(options) > 2 else ''
  
          se = Seeker(aname, stype, sname, find_callback=_print_result, error_callback=_print_error)
          se.run()
      else:
          _usage('Unknown subcommand "' + sys.argv[0] + '"')