Browse Source

Added --version flag to nesi

Corey Prophitt 5 years ago
parent
commit
a71a375f20
2 changed files with 15 additions and 3 deletions
  1. 2 1
      README.md
  2. 13 2
      nesi

+ 2 - 1
README.md

@@ -20,13 +20,14 @@ Usage
 
 Nesi is a command line application. The basic usage can be found below:
 
-    usage: nesi [-h] [-r ROM]
+    usage: nesi [-h] [-r ROM] [-v]
 
     Specify a .nes rom image to be analyzed
 
     optional arguments:
       -h, --help         show this help message and exit
       -r ROM, --rom ROM  path to a .nes rom image to be analyzed
+      -v, --version      show the current nesi version
 
 License
 -------

+ 13 - 2
nesi

@@ -13,10 +13,12 @@
 '''
 
 # Import all standard library modules
+from __future__ import print_function
+
 import argparse
 
 # Import all nesi modules
-from nes.rom import NesRom
+from nes import rom
 
 
 def main():
@@ -36,10 +38,19 @@ def main():
         type=str
     )
 
+    parser.add_argument(
+        '-v',
+        '--version',
+        help='show the current nesi version',
+        action='store_true'
+    )
+
     args = parser.parse_args()
 
     if args.rom:
-        NesRom(args.rom).print_analysis()
+        rom.NesRom(args.rom).print_analysis()
+    elif args.version:
+        print(rom.nesi_information())
     else:
         parser.print_help()