java.lang.Object
org.variantsync.studies.evolution.simulation.shell.ShellCommand
org.variantsync.studies.evolution.simulation.shell.DiffCommand

public class DiffCommand extends ShellCommand
Represents a shell 'diff' command that can be executed using a ShellExecutor
  • Constructor Details

    • DiffCommand

      public DiffCommand(String... files)
  • Method Details

    • Recommended

      public static DiffCommand Recommended(Path pathA, Path pathB)
      DiffCommand configured as recommended by the documentation in 'patch' (i.e. 'man patch')
      Parameters:
      pathA - The path to the source file
      pathB - The path to the target file
      Returns:
      A configured DiffCommand
    • parts

      public String[] parts()
      Description copied from class: ShellCommand
      Return the String parts that define and configure the command execution (e.g., ["echo", "Hello World"])
      Specified by:
      parts in class ShellCommand
      Returns:
      the parts of the shell command.
    • newFile

      public DiffCommand newFile()
      Treat absent files as empty
      Returns:
      this command
    • text

      public DiffCommand text()
      Treat all files as text
      Returns:
      this command
    • unified

      public DiffCommand unified()
      Output three lines of unified context
      Returns:
      this command
    • recursive

      public DiffCommand recursive()
      Recursively compare any subdirectories found
      Returns:
      this command
    • toString

      public String toString()
      Overrides:
      toString in class ShellCommand
    • interpretResult

      public org.variantsync.functjonal.Result<List<String>,ShellException> interpretResult(int code, List<String> output)
      Description copied from class: ShellCommand
      Interpret the result code returned from a shell command
      Overrides:
      interpretResult in class ShellCommand
      Parameters:
      code - the code that is to be parsed
      Returns:
      the result