use of org.fagu.fmv.core.exec.Executable in project fmv by f-agu.
the class ToExecutable method run.
/**
* @see org.fagu.fmv.cli.Command#run(java.lang.String[])
*/
@Override
public void run(String[] args) {
if (args.length != 1) {
help();
return;
}
String id = args[0];
if (".".equals(id)) {
environnement.setCurrentExecutable(null);
return;
}
Optional<Identifiable> opt = BaseIdentifiable.findById(project, id);
if (!opt.isPresent()) {
println("ID not found: " + id);
return;
}
Identifiable identifiable = opt.get();
if (!(identifiable instanceof Executable)) {
println("ID is not an executable: " + id);
return;
}
Executable executable = (Executable) identifiable;
environnement.setCurrentExecutable(executable);
}
Aggregations