/*
 * app_filter.cpp
 *
 *  Created on: Sep 26, 2025
 *      Author: anders
 */


#include <cstdint>
#include <vector>
#include <map>
#include <fstream>

#include "gfanlib_tableau.h"
#include "gfanapplication.h"
#include "printer.h"
#include "log.h"

using namespace std;
using namespace gfan;

class FilterApplication : public GFanApplication
{
	IntegerOption optionFirstN;
public:
  bool includeInDefaultInstallation()
  {
    return false;
  }
  const char *helpText()
  {
    return "This program is used for filtering various sorts of input.\n";
  }
  FilterApplication():
	  optionFirstN("--firstn","Output the number of cones in input")
  {
	  registerOptions();
  }

  const char *name()
  {
    return "_filter";
  }
  int main()
  {
	  if(optionFirstN.getValue())
	  {
		  SequenceStreamIterator i(std::cin,true);
		  int64_t I=0;
		  std::cout<<"{";
		  bool first=true;
		  while(!i.eof())
		  {
			  if(I>=optionFirstN.getValue())break;
			  if(!first)std::cout<<",\n";
			  auto s=i.getNextString();
			  std::cout<<s;
			  I++;
			  first=false;
		  }
		  std::cout<<"}\n";
	  }
	  else
	  {
		  cerr<<"No filter selected.\n";
		  assert(0);
	  }
	  return 0;
  }
};

static FilterApplication theApplication;


