Updated example to cat the version properties file.

This commit is contained in:
Erik C. Thauvin 2018-07-07 01:40:16 -07:00
parent abe1ca269c
commit b50f2bad9a
10 changed files with 58 additions and 26 deletions

View file

@ -11,8 +11,9 @@ public class App {
public void cat(String name) {
try {
final List<String> content = Files.readAllLines(Paths.get(name));
System.out.println("> cat " + name);
for (String line : content) {
if (!line.startsWith("#")) System.out.println(line);
System.out.println(line);
}
} catch (IOException e) {
System.out.println(e);

View file

@ -1,4 +1,8 @@
f = new File("examples.properties")
println(f.absoluteFile)
println(f.exists())
println(f.canRead())
if (this.args.length > 0) {
for (arg in this.args) {
f = new File(arg)
println("${f.name}\t-> exits: ${f.exists()}, canRead: ${f.canRead()} --> `${f.absoluteFile}`")
}
} else {
println("Usage: groovy ${this.class.getName()} filename")
}