code: def main():
      
  
      parser = ArgumentParser(prog="hwinfo")
  
      filter_choices = ['bios', 'nic', 'storage', 'gpu', 'cpu']
      parser.add_argument("-f", "--filter", choices=filter_choices, help="Query a specific class.")
      parser.add_argument("-m", "--machine", default='localhost', help="Remote host address.")
      parser.add_argument("-u", "--username", help="Username for remote host.")
      parser.add_argument("-p", "--password", help="Password for remote host.")
      parser.add_argument("-l", "--logs", help="Path to the directory with the logfiles.")
      parser.add_argument("-e", "--export", action="store_true", help="Export result in JSON format.")
  
      args = parser.parse_args()
      validate_args(args)
  
      if args.logs:
          if ".tar" in args.logs:
              host = HostFromTarball(args.logs)
          else:
              host = HostFromLogs(args.logs)
      else:
          host = Host(args.machine, args.username, args.password)
  
      options = []
  
      if args.filter:
          filter_args = args.filter.split(',')
          for arg in filter_args:
              options.append(arg.strip())
      else:
          options = filter_choices
  
      if args.export:
          print export_system_info(host, options)
      else:
          print system_info(host, options)
docs: Entry Point