diff --git a/hbs2-cli/lib/HBS2/CLI/Run/Internal.hs b/hbs2-cli/lib/HBS2/CLI/Run/Internal.hs index 623b92f3..6ee54b8e 100644 --- a/hbs2-cli/lib/HBS2/CLI/Run/Internal.hs +++ b/hbs2-cli/lib/HBS2/CLI/Run/Internal.hs @@ -8,6 +8,8 @@ module HBS2.CLI.Run.Internal import HBS2.CLI.Prelude +import HBS2.System.Dir + import HBS2.OrDie import HBS2.Base58 import HBS2.Data.Types.Refs @@ -168,6 +170,19 @@ internalEntries = do -- TODO: re-implement-all-on-top-of-opaque + -- TODO: move-somewhere + entry $ bindMatch "rm" $ nil_ \case + [ StringLike p ] -> rm p + _ -> throwIO (BadFormException @c nil) + + entry $ bindMatch "touch" $ nil_ \case + [ StringLike p ] -> touch p + _ -> throwIO (BadFormException @c nil) + + entry $ bindMatch "mkdir" $ nil_ \case + [ StringLike p ] -> mkdir p + _ -> throwIO (BadFormException @c nil) + entry $ bindMatch "blob:base58" $ \case [LitStrVal t] -> do bs <- pure (Text.unpack t & BS8.pack & fromBase58) diff --git a/miscellaneous/suckless-conf/lib/Data/Config/Suckless/Script/Internal.hs b/miscellaneous/suckless-conf/lib/Data/Config/Suckless/Script/Internal.hs index d243b2ee..672d7146 100644 --- a/miscellaneous/suckless-conf/lib/Data/Config/Suckless/Script/Internal.hs +++ b/miscellaneous/suckless-conf/lib/Data/Config/Suckless/Script/Internal.hs @@ -1006,6 +1006,16 @@ internalEntries = do --TODO: integral sum + entry $ bindMatch "upper" $ \case + [ LitStrVal x ] -> pure $ mkStr $ Text.toUpper x + [ SymbolVal (Id x) ] -> pure $ mkSym $ Text.toUpper x + _ -> pure nil + + entry $ bindMatch "lower" $ \case + [ LitStrVal x ] -> pure $ mkStr $ Text.toLower x + [ SymbolVal (Id x) ] -> pure $ mkSym $ Text.toLower x + _ -> pure nil + entry $ bindMatch "words" $ \case [ TextLike x ] -> pure $ mkList [ mkSym y | y <- Text.words x ] _ -> pure nil