com.g2forge.alexandria.command.CommandInvocation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ax-command Show documentation
Show all versions of ax-command Show documentation
Library for command line programming.
package com.g2forge.alexandria.command;
import java.io.InputStream;
import java.io.PrintStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import com.g2forge.alexandria.command.stdio.IStandardIO;
import com.g2forge.alexandria.command.stdio.StandardIO;
import com.g2forge.alexandria.java.core.helpers.HCollection;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Singular;
@Data
@Builder(toBuilder = true)
@AllArgsConstructor
public class CommandInvocation {
public static final CommandInvocation of(String... args) {
final CommandInvocation.CommandInvocationBuilder retVal = CommandInvocation.builder();
retVal.arguments(HCollection.asList(args));
retVal.io(StandardIO.of());
retVal.working(Paths.get(System.getProperty("user.dir")));
return retVal.build();
}
@Singular
protected final List arguments;
protected final IStandardIO io;
protected final Path working;
}