diff --git a/README.md b/README.md index aa371d1..2d9baef 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ ![alt text](https://github.com/borisf/classyshark-bytecode-viewer/blob/master/img/CS%20Viewer.png) +## Download & Run +To run, grab the [latest JAR](https://github.com/borisf/classyshark-bytecode-viewer/releases) +and run `java -jar ClassySharkBytecodeViewer.jar`. Optionally you can add a class file to open. + ## Why Instantaneously assess performance impact of my Kotlin code on a [class](https://en.wikipedia.org/wiki/Java_class_file) level. diff --git a/img/CS Viewer.png b/img/CS Viewer.png index 0a0ff77..f41af26 100644 Binary files a/img/CS Viewer.png and b/img/CS Viewer.png differ diff --git a/src/ClassySharkBytecodeViewer.kt b/src/ClassySharkBytecodeViewer.kt index 2082949..8cced6d 100644 --- a/src/ClassySharkBytecodeViewer.kt +++ b/src/ClassySharkBytecodeViewer.kt @@ -35,7 +35,9 @@ constructor() : JFrame() { object IntroTextHolder { @JvmStatic val INTRO_TEXT = "\n\n\n\n\n\n\n\n\n\n" + - " Drag your class file over here ....\n" + " Drag your class file over here ....\n" + + "\n\n\n\n\n ClassyShark ByteCode Viewer ver." + + Version.MAJOR + "." + Version.MINOR } init { @@ -168,8 +170,15 @@ constructor() : JFrame() { @JvmStatic fun main(args: Array) { SwingUtilities.invokeLater { try { - val csbv = ClassySharkBytecodeViewer() - csbv.isVisible = true + val bytecodeViewer = ClassySharkBytecodeViewer() + + if (args.size == 1) { + bytecodeViewer.onFileDragged(File(args[0])) + } else if (args.size > 1) { + System.out.println("Usage: java -jar ClassySharkBytecodeViewer.jar ") + } + + bytecodeViewer.isVisible = true } catch (e: Exception) { e.printStackTrace() } diff --git a/src/Version.kt b/src/Version.kt new file mode 100644 index 0000000..7ade339 --- /dev/null +++ b/src/Version.kt @@ -0,0 +1,7 @@ +/** + * This class holds the current ClassySharkBytecodeViewer version + */ +object Version { + val MAJOR = 5 + val MINOR = 0 +} \ No newline at end of file