From ef6892fd6a3c95d7076b0e707f20f38430d8948b Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 30 Apr 2025 10:47:54 +0200 Subject: Improve rtt-show commands. rtt show GAME [ JSON-PATH ] rtt show-snap GAME [ SNAP [ JSON-PATH ] ] For example: rtt show 123 active rtt show 123 undo rtt show 123 hand[0] --- bin/rtt-show | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 bin/rtt-show (limited to 'bin/rtt-show') diff --git a/bin/rtt-show b/bin/rtt-show new file mode 100755 index 0000000..b643a8c --- /dev/null +++ b/bin/rtt-show @@ -0,0 +1,10 @@ +#!/bin/bash +if [ "$#" = 1 ] +then + sqlite3 db "select json_remove(json_remove(state, '$.undo'), '$.log') from game_state where game_id = $1" +elif [ "$#" = 2 ] +then + sqlite3 db "select state -> '$.$2' from game_state where game_id = $1" +else + echo "usage: rtt-show GAME [ JSON-PATH ]" +fi -- cgit v1.2.3