From: Niki Roo Date: Wed, 23 Apr 2025 16:35:11 +0000 (+0200) Subject: new --info-options + (*) X-Git-Url: http://git.nikiroo.be/?a=commitdiff_plain;h=cf1906fb31b5e968bffe0f93fbc7460279ba2a4f;p=gamiki.git new --info-options + (*) --- diff --git a/gamiki.py b/gamiki.py index 20cd68d..abbcf82 100755 --- 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"]) diff --git a/gamiki/builder.py b/gamiki/builder.py index 45c84df..1e3fc2c 100644 --- a/gamiki/builder.py +++ b/gamiki/builder.py @@ -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):