code: def cli(env, package_keyname, required):
      
      client = env.client
      manager = ordering.OrderingManager(client)
      table = formatting.Table(COLUMNS)
  
      categories = manager.list_categories(package_keyname)
  
      if required:
          categories = [cat for cat in categories if cat['isRequired']]
  
      for cat in categories:
          table.add_row([
              cat['itemCategory']['name'],
              cat['itemCategory']['categoryCode'],
              'Y' if cat['isRequired'] else 'N'
          ])
  
      env.fout(table)
docs: List the categories of a package.
  
      ::
  
          # List the categories of Bare Metal servers
          slcli order category-list BARE_METAL_SERVER
  
          # List the required categories for Bare Metal servers
          slcli order category-list BARE_METAL_SERVER --required