new --info-options + (*)
authorNiki Roo <niki@nikiroo.be>
Wed, 23 Apr 2025 16:35:11 +0000 (18:35 +0200)
committerNiki Roo <niki@nikiroo.be>
Wed, 23 Apr 2025 16:35:11 +0000 (18:35 +0200)
gamiki.py
gamiki/builder.py

index 20cd68d1b827df602d71aaa09fc312dbf6ed9648..abbcf82d162b8d6ed1475ccde8bf26e8398ab94e 100755 (executable)
--- a/gamiki.py
+++ b/gamiki.py
@@ -58,6 +58,10 @@ game_actions.add_argument("--info-tags",
     help="get all the tags of the game, one per line",
     metavar="GAME"
 )
+game_actions.add_argument("--info-options", 
+    help="get all the option modes of the game",
+    metavar="GAME"
+)
 game_actions.add_argument("--info-icon", 
     help="get the icon of the game",
     metavar="GAME"
@@ -87,6 +91,8 @@ elif (args.info_desc):
     g = args.info_desc
 elif (args.info_tags):
     g = args.info_tags
+elif (args.info_options):
+    g = args.info_options
 elif (args.info_icon):
     g = args.info_icon
 else:
@@ -123,6 +129,9 @@ elif (args.info_desc):
 elif (args.info_tags):
     for tag in game.tags:
         print(tag)
+elif (args.info_options):
+    for (opt, desc) in game.opts.items():
+        print(opt + ":", desc)
 elif (args.info_icon):
     if ("Icon" in game):
         print(game["Icon"])
index 45c84df5d356e5d966ee4f478b7fa36e7471d04d..1e3fc2cb4669bec41cb146fb224d0f0b8a54619d 100644 (file)
@@ -41,7 +41,10 @@ class Builder:
     def list(self):
         i = 1
         for game in self.games:
-            print("{0:6d}".format(i), "", game.name)
+            n = "  " + game.name
+            if (game.opts):
+                n = "* " + game.name
+            print("{0:6d}".format(i) + n)
             i += 1
     
     def list_tag(self):