summaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2020-03-21 21:35:46 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2020-03-21 21:35:46 +0100
commitbc47aa7472e05b810339752da4d34bc04d37ef72 (patch)
treed7e94c2694198a1f0a061237da8fe145ee96620f /src/Main.hs
parent38a22490180c5e98d5ad105938a89ff31f29d349 (diff)
Generation number for stored objects
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Main.hs b/src/Main.hs
index b692357..0398233 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -32,6 +32,7 @@ import PubKey
import Service
import State
import Storage
+import Storage.Merge
import Sync
main :: IO ()
@@ -69,6 +70,10 @@ main = do
Nothing -> putStrLn $ "Identity verification failed"
_ -> error $ "unknown object type '" ++ objtype ++ "'"
+ ["show-generation", sref] -> readRef st (BC.pack sref) >>= \case
+ Nothing -> error "ref does not exist"
+ Just ref -> print $ storedGeneration (wrappedLoad ref :: Stored Object)
+
["update-identity"] -> updateSharedIdentity st
("update-identity" : srefs) -> do