From aa911e2b0f4553b58ff87ae3b59117ddde9899bd Mon Sep 17 00:00:00 2001 From: Sergey Ivanov Date: Mon, 20 Mar 2023 21:42:58 +0400 Subject: [PATCH] Extract lref - cli subcommands --- hbs2-peer/app/PeerMain.hs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hbs2-peer/app/PeerMain.hs b/hbs2-peer/app/PeerMain.hs index cc761a52..0fa78b86 100644 --- a/hbs2-peer/app/PeerMain.hs +++ b/hbs2-peer/app/PeerMain.hs @@ -241,12 +241,7 @@ runCLI = join . customExecParser (prefs showHelpOnError) $ <> command "fetch" (info pFetch (progDesc "fetch block")) <> command "peers" (info pPeers (progDesc "show known peers")) <> command "log" (info pLog (progDesc "set logging level")) - <> command "lref-ann" (info pLRefAnn (progDesc "announce linear ref")) - <> command "lref-new" (info pLRefNew (progDesc "generates a new linear ref")) - <> command "lref-list" (info pLRefList (progDesc "list node linear refs")) - <> command "lref-get" (info pLRefGet (progDesc "get a linear ref")) - <> command "lref-update" (info pLRefUpdate (progDesc "updates a linear ref")) - <> command "lref-update-raw" (info pLRefUpdateRaw (progDesc "updates a linear ref with already signed data")) + <> command "lref" (info pLRef (progDesc "lref commands")) ) confOpt = strOption ( long "config" <> short 'c' <> help "config" ) @@ -317,6 +312,14 @@ runCLI = join . customExecParser (prefs showHelpOnError) $ pref <- optional $ strArgument ( metavar "DIR" ) pure $ peerConfigInit pref + pLRef = hsubparser $ + command "ann" (info pLRefAnn (progDesc "announce linear ref")) + <> command "new" (info pLRefNew (progDesc "generates a new linear ref")) + <> command "list" (info pLRefList (progDesc "list node linear refs")) + <> command "get" (info pLRefGet (progDesc "get a linear ref")) + <> command "update" (info pLRefUpdate (progDesc "updates a linear ref")) + <> command "update-raw" (info pLRefUpdateRaw (progDesc "updates a linear ref with already signed data")) + pLRefAnn = do rpc <- pRpcCommon h <- strArgument ( metavar "HASH" )