// Path: public-java/io/iamcontent-cli/src/main/java/com/iamcontent/io/cli/LicenseWriter.java
// public static LicenseWriter licenseWriter() {
// 	return new LicenseWriter();
// }
// 
// Path: public-java/io/iamcontent-io-core/src/main/java/com/iamcontent/io/util/Readers.java
// public static BufferedReader bufferedReader(InputStream is) {
// 	return bufferedReader(inputStreamReader(is));
// }


import static com.iamcontent.io.cli.LicenseWriter.licenseWriter;
import static com.iamcontent.io.util.Readers.bufferedReader;
import java.io.BufferedReader;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Stream;

/**
  IAmContent Public Libraries.
  Copyright (C) 2015-2021 Greg Elderfield
  @author Greg Elderfield, support@jarchitect.co.uk
 
  This program is free software; you can redistribute it and/or modify it under the terms of the
  GNU General Public License as published by the Free Software Foundation; either version 2 of 
  the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the GNU General Public License for more details.

  You should have received a copy of the GNU General Public License along with this program;
  if not, write to the Free Software Foundation, Inc., 
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
package com.iamcontent.io.cli;



/**
 * Foundation class for Command Line Interface (CLI) drivers.
 * @author Greg Elderfield
 */
public abstract class CommandLineDriver {

	private final LicenseWriter licenseWriter = licenseWriter();

	protected final BufferedReader in;
	private final List<Predicate<String>> commandHandlers = new ArrayList<>();
	
	public CommandLineDriver() {

// Path: public-java/io/iamcontent-cli/src/main/java/com/iamcontent/io/cli/LicenseWriter.java
// public static LicenseWriter licenseWriter() {
// 	return new LicenseWriter();
// }
// 
// Path: public-java/io/iamcontent-io-core/src/main/java/com/iamcontent/io/util/Readers.java
// public static BufferedReader bufferedReader(InputStream is) {
// 	return bufferedReader(inputStreamReader(is));
// }


// Path: public-java/io/iamcontent-cli/src/main/java/com/iamcontent/io/cli/CommandLineDriver.java
import static com.iamcontent.io.cli.LicenseWriter.licenseWriter;
import static com.iamcontent.io.util.Readers.bufferedReader;
import java.io.BufferedReader;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Stream;

/**
  IAmContent Public Libraries.
  Copyright (C) 2015-2021 Greg Elderfield
  @author Greg Elderfield, support@jarchitect.co.uk
 
  This program is free software; you can redistribute it and/or modify it under the terms of the
  GNU General Public License as published by the Free Software Foundation; either version 2 of 
  the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the GNU General Public License for more details.

  You should have received a copy of the GNU General Public License along with this program;
  if not, write to the Free Software Foundation, Inc., 
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
package com.iamcontent.io.cli;



/**
 * Foundation class for Command Line Interface (CLI) drivers.
 * @author Greg Elderfield
 */
public abstract class CommandLineDriver {

	private final LicenseWriter licenseWriter = licenseWriter();

	protected final BufferedReader in;
	private final List<Predicate<String>> commandHandlers = new ArrayList<>();
	
	public CommandLineDriver() {

		this(bufferedReader(System.in));
