// Path: bin/src/io/github/alechenninger/monarch/apply/ApplyChangesInput.java
// public interface ApplyChangesInput {
//   Optional<String> getHierarchyPathOrYaml();
// 
//   Optional<String> getChangesPathOrYaml();
// 
//   Optional<SourceSpec> getTarget();
// 
//   Optional<String> getDataDir();
// 
//   List<String> getConfigPaths();
// 
//   Optional<String> getOutputDir();
// 
//   List<String> getMergeKeys();
// 
//   boolean isHelpRequested();
// 
//   String getHelpMessage();
// 
//   Optional<YamlConfiguration.Isolate> getYamlIsolate();
// 
// }
// 
// Path: bin/src/io/github/alechenninger/monarch/set/UpdateSetInput.java
// public interface UpdateSetInput {
//   /**
//    * Path of changes to read from and update (or create, if the path does not exist).
//    */
//   Optional<String> getChangesPath();
// 
//   /**
//    * Source for the change we wish to modify or create.
//    */
//   Optional<SourceSpec> getSource();
// 
//   /**
//    * A list of key value pairs to add or replace in the set block of the source's change.
//    *
//    * <p>The list may contain paths to yaml files or inline yaml heterogeneously.
//    */
//   List<String> getPutPathsOrYaml();
// 
//   /**
//    * A list of keys to remove from the set block of the source's change.
//    */
//   List<String> getRemovals();
// 
//   Optional<String> getHierarchyPathOrYaml();
// 
//   List<String> getConfigPaths();
// 
//   boolean isHelpRequested();
// 
//   String getHelpMessage();
// }
// 
// Path: bin/src/io/github/alechenninger/monarch/yaml/YamlConfiguration.java
// public interface YamlConfiguration {
//   YamlConfiguration DEFAULT = new Default();
// 
//   default int indent() {
//     return 2;
//   }
// 
//   default Isolate updateIsolation() {
//     return Isolate.ALWAYS;
//   }
// 
//   enum Isolate {
//     ALWAYS,
//     // TODO: Support WHEN_POSSIBLE
//     // This involves modifying unmanaged portion while maintaining formatting and whitespace.
//     // Not trivial to do.
//     //WHEN_POSSIBLE,
//     NEVER;
//   }
// 
//   /** Extendable for reusable toString */
//   class Default implements YamlConfiguration {
//     @Override
//     public String toString() {
//       return "YamlConfiguration{" +
//           "indent=" + indent() +
//           ", updateIsolation=" + updateIsolation() +
//           '}';
//     }
//   }
// }


import io.github.alechenninger.monarch.apply.ApplyChangesInput;
import io.github.alechenninger.monarch.set.UpdateSetInput;
import io.github.alechenninger.monarch.yaml.YamlConfiguration;
import net.sourceforge.argparse4j.ArgumentParsers;
import net.sourceforge.argparse4j.impl.Arguments;
import net.sourceforge.argparse4j.impl.action.StoreTrueArgumentAction;
import net.sourceforge.argparse4j.inf.Argument;
import net.sourceforge.argparse4j.inf.ArgumentAction;
import net.sourceforge.argparse4j.inf.ArgumentParser;
import net.sourceforge.argparse4j.inf.ArgumentParserException;
import net.sourceforge.argparse4j.inf.MutuallyExclusiveGroup;
import net.sourceforge.argparse4j.inf.Namespace;
import net.sourceforge.argparse4j.inf.Subparser;
import net.sourceforge.argparse4j.inf.Subparsers;
import net.sourceforge.argparse4j.internal.UnrecognizedArgumentException;
import net.sourceforge.argparse4j.internal.UnrecognizedCommandException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.logging.Level;
import java.util.stream.Collectors;
          .help("Identifies the change to operate on by its data source. May be defined as a " +
              "single data source path, or as a set of key=value pairs which evaluate to a " +
              "single source in a dynamic hierarchy. For example:\n" +
              "teams/myteam.yaml\n" +
              "environment=qa team=ops");

      subparser.addArgument("--put", "-p")
          .dest("put")
          .nargs("+")
          .help("Key value pairs to add or replace in the set block of the source's change.\n"
              + "The list may contain paths to yaml files or inline yaml heterogeneously.");

      subparser.addArgument("--remove", "-r")
          .dest("remove")
          .nargs("+")
          .help("List of keys to remove from the set block of a change.\n"
              + "Applied after 'put' so this may remove keys set by the 'put' argument.");

      subparser.addArgument("--hierarchy", "-h")
          .dest("hierarchy")
          .help("Optional path to hierarchy. Only used for sorting entries in the output " +
              "changes. For more information about hierarchies, see: apply --help");

      subparser.addArgument("--configs", "--config")
          .dest("configs")
          .metavar("CONFIG")
          .nargs("+")
          .help(SHARED_CONFIG_HELP + "\n" +
              "\n" +
              "The only config value read is 'hierarchy', which is used to sort the changes from " +
// Path: bin/src/io/github/alechenninger/monarch/apply/ApplyChangesInput.java
// public interface ApplyChangesInput {
//   Optional<String> getHierarchyPathOrYaml();
// 
//   Optional<String> getChangesPathOrYaml();
// 
//   Optional<SourceSpec> getTarget();
// 
//   Optional<String> getDataDir();
// 
//   List<String> getConfigPaths();
// 
//   Optional<String> getOutputDir();
// 
//   List<String> getMergeKeys();
// 
//   boolean isHelpRequested();
// 
//   String getHelpMessage();
// 
//   Optional<YamlConfiguration.Isolate> getYamlIsolate();
// 
// }
// 
// Path: bin/src/io/github/alechenninger/monarch/set/UpdateSetInput.java
// public interface UpdateSetInput {
//   /**
//    * Path of changes to read from and update (or create, if the path does not exist).
//    */
//   Optional<String> getChangesPath();
// 
//   /**
//    * Source for the change we wish to modify or create.
//    */
//   Optional<SourceSpec> getSource();
// 
//   /**
//    * A list of key value pairs to add or replace in the set block of the source's change.
//    *
//    * <p>The list may contain paths to yaml files or inline yaml heterogeneously.
//    */
//   List<String> getPutPathsOrYaml();
// 
//   /**
//    * A list of keys to remove from the set block of the source's change.
//    */
//   List<String> getRemovals();
// 
//   Optional<String> getHierarchyPathOrYaml();
// 
//   List<String> getConfigPaths();
// 
//   boolean isHelpRequested();
// 
//   String getHelpMessage();
// }
// 
// Path: bin/src/io/github/alechenninger/monarch/yaml/YamlConfiguration.java
// public interface YamlConfiguration {
//   YamlConfiguration DEFAULT = new Default();
// 
//   default int indent() {
//     return 2;
//   }
// 
//   default Isolate updateIsolation() {
//     return Isolate.ALWAYS;
//   }
// 
//   enum Isolate {
//     ALWAYS,
//     // TODO: Support WHEN_POSSIBLE
//     // This involves modifying unmanaged portion while maintaining formatting and whitespace.
//     // Not trivial to do.
//     //WHEN_POSSIBLE,
//     NEVER;
//   }
// 
//   /** Extendable for reusable toString */
//   class Default implements YamlConfiguration {
//     @Override
//     public String toString() {
//       return "YamlConfiguration{" +
//           "indent=" + indent() +
//           ", updateIsolation=" + updateIsolation() +
//           '}';
//     }
//   }
// }


// Path: bin/src/io/github/alechenninger/monarch/ArgParseMonarchArgParser.java
import io.github.alechenninger.monarch.apply.ApplyChangesInput;
import io.github.alechenninger.monarch.set.UpdateSetInput;
import io.github.alechenninger.monarch.yaml.YamlConfiguration;
import net.sourceforge.argparse4j.ArgumentParsers;
import net.sourceforge.argparse4j.impl.Arguments;
import net.sourceforge.argparse4j.impl.action.StoreTrueArgumentAction;
import net.sourceforge.argparse4j.inf.Argument;
import net.sourceforge.argparse4j.inf.ArgumentAction;
import net.sourceforge.argparse4j.inf.ArgumentParser;
import net.sourceforge.argparse4j.inf.ArgumentParserException;
import net.sourceforge.argparse4j.inf.MutuallyExclusiveGroup;
import net.sourceforge.argparse4j.inf.Namespace;
import net.sourceforge.argparse4j.inf.Subparser;
import net.sourceforge.argparse4j.inf.Subparsers;
import net.sourceforge.argparse4j.internal.UnrecognizedArgumentException;
import net.sourceforge.argparse4j.internal.UnrecognizedCommandException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.logging.Level;
import java.util.stream.Collectors;

          .help("Identifies the change to operate on by its data source. May be defined as a " +
              "single data source path, or as a set of key=value pairs which evaluate to a " +
              "single source in a dynamic hierarchy. For example:\n" +
              "teams/myteam.yaml\n" +
              "environment=qa team=ops");

      subparser.addArgument("--put", "-p")
          .dest("put")
          .nargs("+")
          .help("Key value pairs to add or replace in the set block of the source's change.\n"
              + "The list may contain paths to yaml files or inline yaml heterogeneously.");

      subparser.addArgument("--remove", "-r")
          .dest("remove")
          .nargs("+")
          .help("List of keys to remove from the set block of a change.\n"
              + "Applied after 'put' so this may remove keys set by the 'put' argument.");

      subparser.addArgument("--hierarchy", "-h")
          .dest("hierarchy")
          .help("Optional path to hierarchy. Only used for sorting entries in the output " +
              "changes. For more information about hierarchies, see: apply --help");

      subparser.addArgument("--configs", "--config")
          .dest("configs")
          .metavar("CONFIG")
          .nargs("+")
          .help(SHARED_CONFIG_HELP + "\n" +
              "\n" +
              "The only config value read is 'hierarchy', which is used to sort the changes from " +
              "top-most to bottom-most");