From 74659bffc61203841b04063da9f22bfaa5625eaa Mon Sep 17 00:00:00 2001 From: voidlizard Date: Thu, 20 Feb 2025 06:15:43 +0300 Subject: [PATCH] remotes alias --- hbs2-git3/lib/HBS2/Git3/Man.hs | 4 ++++ hbs2-git3/lib/HBS2/Git3/Run.hs | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/hbs2-git3/lib/HBS2/Git3/Man.hs b/hbs2-git3/lib/HBS2/Git3/Man.hs index 63a5d698..e60e2a0e 100644 --- a/hbs2-git3/lib/HBS2/Git3/Man.hs +++ b/hbs2-git3/lib/HBS2/Git3/Man.hs @@ -5,6 +5,10 @@ import Data.Config.Suckless.Script import Text.InterpolatedString.Perl6 (qc) +manRemotes :: MakeDictM c m () -> MakeDictM c m () +manRemotes = brief "show known hbs2-git remotes" + + manInit :: MakeDictM c m () -> MakeDictM c m () manInit = brief "initializes a new repository" . args [ arg "new repository flag" "--new" diff --git a/hbs2-git3/lib/HBS2/Git3/Run.hs b/hbs2-git3/lib/HBS2/Git3/Run.hs index 374fed22..55a26abd 100644 --- a/hbs2-git3/lib/HBS2/Git3/Run.hs +++ b/hbs2-git3/lib/HBS2/Git3/Run.hs @@ -63,7 +63,7 @@ theDict = do where - myEntries = hidePrefixes ["test", "debug", "segment", "reflog:index"] do + myEntries = hidePrefixes ["test", "debug", "segment", "reflog:index", "tss"] do entry $ bindMatch "--help" $ nil_ $ \case HelpEntryBound what -> do helpEntry what @@ -449,12 +449,14 @@ compression ; prints compression level getRepoManifest >>= liftIO . print . pretty . mkForm "manifest" . coerce - entry $ bindMatch "repo:remotes" $ nil_ $ \syn -> lift do + manRemotes $ entry $ bindAlias "remotes" "repo:remotes" - remotes <- listRemotes - - liftIO $ for_ remotes $ \(r,k) -> do - print $ fill 44 (pretty (AsBase58 k)) <+> pretty r + hidden $ + manRemotes $ + entry $ bindMatch "repo:remotes" $ nil_ $ const $ lift do + remotes <- listRemotes + liftIO $ for_ remotes $ \(r,k) -> do + print $ fill 44 (pretty (AsBase58 k)) <+> pretty r entry $ bindMatch "reflog:imported" $ nil_ $ \syn -> lift $ connectedDo do resolveRepoKeyThrow syn >>= setGitRepoKey