@Test public void fails_with_both_version_and_help_flag() { assertThatThrownBy(() -> cli.execute(new String[] {"--help", "--version"})) .hasMessage("Either --version or --help must be set, not both") .isInstanceOf(RuntimeException.class); }
void execute(String[] args) { registry .resolve(args) .orElseThrow(() -> new RuntimeException( String.format("Could not resolve command. Given args: %s%n", Arrays.toString(args)) )) .accept(this.liquigraph); }
LiquigraphCli { void execute(String[] args) { registry .resolve(args) .orElseThrow(() -> new RuntimeException( String.format("Could not resolve command. Given args: %s%n", Arrays.toString(args)) )) .accept(this.liquigraph); } }
LiquigraphCli { void execute(String[] args) { registry .resolve(args) .orElseThrow(() -> new RuntimeException( String.format("Could not resolve command. Given args: %s%n", Arrays.toString(args)) )) .accept(this.liquigraph); } LiquigraphCli(LiquigraphApi liquigraph); }
LiquigraphCli { void execute(String[] args) { registry .resolve(args) .orElseThrow(() -> new RuntimeException( String.format("Could not resolve command. Given args: %s%n", Arrays.toString(args)) )) .accept(this.liquigraph); } LiquigraphCli(LiquigraphApi liquigraph); static void main(String[] args); }
LiquigraphCli { void execute(String[] args) { registry .resolve(args) .orElseThrow(() -> new RuntimeException( String.format("Could not resolve command. Given args: %s%n", Arrays.toString(args)) )) .accept(this.liquigraph); } LiquigraphCli(LiquigraphApi liquigraph); static void main(String[] args);  }