!7 //set flag LeanMode. p { S cmd = first(args); S archiveName = second(args); if (eqic(cmd, "x")) { print("Extracting"); if (empty(archiveName)) ret with print("Need archive name as second argument"); } else if (eqic(cmd, "c")) { print("Creating"); if (empty(archiveName)) ret with print("Need archive name as second argument"); } else if (eqic(cmd, "t")) { print("Listing"); if (empty(archiveName)) ret with print("Need archive name as second argument"); File f = newFile(archiveName); if (!fileExists(f)) ret with print("File not found: " + f.getAbsolutePath()); LineCompReader lcr = new(f); for (S version : lcr.versions()) print(" " + version); printWithPrecedingNL("Archive " + f.getAbsolutePath() + " contains " + nFiles(l(lcr.versions()))); } else { print(autoUnindent_mls([[ This is LINECOMP v0.1, a supercompressor for a bunch of similar text files. Commands: c archive.lc textFile1 textFile2 ... - create LINECOMP archive archive.lc from files x archive.lc - extract archive.lc to current directory t archive.lc - show contents of archive.lc ]])); } }