From 8f8792508e7d1e7f34d279692da22c17d1607913 Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 22 May 2020 17:57:37 -0400 Subject: add more commands --- name2color.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'name2color.py') diff --git a/name2color.py b/name2color.py index a473301..f1df2a2 100755 --- a/name2color.py +++ b/name2color.py @@ -30,6 +30,7 @@ parser.add_argument('--color-name', type=int, help='manually change the color ma parser.add_argument('--clear-idx', action='store_true') parser.add_argument('--clear-name', action='store_true') parser.add_argument('--clear', action='store_true') +parser.add_argument('--show-state', action='store_true') args = parser.parse_args() state = {} @@ -55,6 +56,12 @@ if len(args.name) > 100: if args.idx < 0 or args.idx >= 1024: error("invalid idx") +if args.show_state: + print("ColorTag: manual coloring for session \"{}\"".format(args.session)) + for (k, v) in state.items(): + print("{} => colour{}".format(k, v)) + sys.exit(0) + if args.clear_idx: try: del state[args.idx] -- cgit v1.2.3