From 12d678dd4dde1c8c4ac349c956c7103709a22b6f Mon Sep 17 00:00:00 2001 From: Katze Miau Date: Tue, 6 Dec 2011 15:54:39 +0000 Subject: add p2ptbl show subcommand lists an entire table (but without the version of each row) diff --git a/files/common/sbin/p2ptbl b/files/common/sbin/p2ptbl index a728a9c..e30a7d0 100755 --- a/files/common/sbin/p2ptbl +++ b/files/common/sbin/p2ptbl @@ -13,6 +13,10 @@ get () { grep "^$2"$'\t' "$1" | cut -f3- } +show () { + cut -f1,3- "$1" +} + update () { [ -n "$2" -a -n "$3" ] || printArgs oldversion=$(grep "^$2"$'\t' "$1" | cut -f2) @@ -80,6 +84,7 @@ printArgs () { echo -e "Usage: $0 init table $0 get table key +$0 show table $0 update table key value [interface] $0 merge table foreign-table $0 gossip table target-size interface" @@ -108,6 +113,10 @@ case "$1" in lockTable -s "$2" get "$2" "$3" ;; + show) + lockTable -s "$2" + show "$2" + ;; update) lockTable -s "$2" update "$2" "$3" "$4" "$5" -- cgit v0.10.1