Skip to content

lost22git/java-string-template-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Some string-template demo

JEP 465: String Templates

string_template_RUNSHELL.java

Usage:

switch(RUNSHELL."java --help") {
    case RunShellResult.Ok(var stdout) -> out.println(stdout);
    case RunShellResult.Fail(var exitCode, var stdout, var stderr) -> {
        out.println(exitCode);
        out.println(stdout);
        out.println(stderr);
    };
    case RunShellResult.Err(var e) -> e.printStackTrace();
}
switch(RUNSHELL."java -x 2>&1") {
    case RunShellResult.Ok(var stdout) -> out.println(stdout);
    case RunShellResult.Fail(var exitCode, var stdout, var stderr) -> {
        out.println(exitCode);
        out.println(stdout);
        out.println(stderr);
    };
    case RunShellResult.Err(var e) -> e.printStackTrace();
}

Run Testing

jbang run string_template_RUNSHELL.java

About

java string template demo

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages