Adding some version information and fixing command-line to actually report version.

This commit is contained in:
Rob Greene 2018-04-04 21:34:04 -05:00
parent aafb68f75c
commit 3b04415763
4 changed files with 18 additions and 4 deletions

View File

@ -16,7 +16,9 @@ mainClassName = 'com.webcodepro.shrinkit.NufxScan'
jar {
manifest {
attributes(
'Main-Class': mainClassName
'Main-Class': mainClassName,
'Implementation-Title': 'ShrinkItArchive',
'Implementation-Version': version
)
}
}

View File

@ -1,7 +1,7 @@
# Universal ShrinkItArchive version number. Used for:
# - Naming JAR file.
# - The build will insert this into a file that is read at run time as well.
version=1.2.1
version=1.2.2
# Maven Central Repository G and A of GAV coordinate. :-)
group=net.sf.applecommander

View File

@ -13,6 +13,12 @@ import com.webcodepro.shrinkit.io.LittleEndianByteInputStream;
* @author robgreene@users.sourceforge.net
*/
public class NuFileArchive {
public static final String VERSION;
static {
VERSION = NuFileArchive.class.getPackage().getImplementationVersion();
}
private MasterHeaderBlock master;
private List<HeaderBlock> headers;
private long totalSize = 0;

View File

@ -21,8 +21,14 @@ public class NufxScan {
private static long sizeOfSmallestCompressedFile;
public static void main(String[] args) throws IOException {
for (String dir : args) {
scanDirectory(dir);
if (args.length == 0) {
System.out.println("Scan NuFX/Shrinkit archives. Please include at least one path name.");
} else if (args.length == 1 && "-v".equals(args[0])) {
System.out.printf("ShrinkIt Library version %s\n", NuFileArchive.VERSION);
} else {
for (String dir : args) {
scanDirectory(dir);
}
}
}