diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2020-03-21 21:35:46 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2020-03-21 21:35:46 +0100 |
commit | bc47aa7472e05b810339752da4d34bc04d37ef72 (patch) | |
tree | d7e94c2694198a1f0a061237da8fe145ee96620f /src/Main.hs | |
parent | 38a22490180c5e98d5ad105938a89ff31f29d349 (diff) |
Generation number for stored objects
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 5 |
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 |