mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
5b3d299d5e
commit
b8db094714
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue