Skip to content

Commit d3161cf

Browse files
committed
Replace v1 ls command
1 parent 800471d commit d3161cf

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

cli/src/Graph/Command.hs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import Models.Edge
3535
import Models.History
3636
import Models.MaterializedPath
3737
import Models.NID
38-
import Models.Node
3938
import Models.NormalizedPath (leastConstrainedNormalizedPath, normalizePath)
4039
import Models.Path.ParsedPath
4140
import Models.Path.Simple (Path)
@@ -183,9 +182,6 @@ interpretCommand = \case
183182
(\a s -> insertEdge (Edge nid (t <> pack s) a))
184183
(toList ambiguities)
185184
suffixes
186-
ListOut -> do
187-
n <- subsumeUserError currentNode
188-
printTransitions n.outgoing
189185
ShowImage -> do
190186
n <- subsumeUserError (currentNode @Text)
191187
forM_ n.rawData $ subsumeUserError @Missing . displayImage . fromStrict
@@ -248,10 +244,8 @@ interpretCommand = \case
248244
put @History history'
249245
Seq ps -> do
250246
toList ps & traverse_ interpretCommand
251-
V2Path p -> do
247+
Preview p -> do
252248
nid <- currentLocation
253-
-- say $ "current location: " ++ tshow nid
254-
-- say $ "parsed path: " ++ tshow p
255249
scoped_ do
256250
p' <- handleDirectivesWith interpretDirective p
257251
mp <- materializePath nid p'

cli/src/Models/Command.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ data Command
2424
Make Path
2525
| -- | mg
2626
Merge Path
27-
| -- | ls
28-
ListOut
2927
| -- | t
3028
Tag Path Path
3129
| Text Text Text
@@ -68,6 +66,6 @@ data Command
6866
Back Int
6967
| -- | Execute a list of commands sequentially
7068
Seq (TwoElemList Command)
71-
| -- | debug-v2-path, v2
72-
V2Path ParsedPath
69+
| -- | preview, ls
70+
Preview ParsedPath
7371
deriving (Eq, Show, Ord, Generic)

cli/src/Models/Command/Parse.hs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ pMake = (command "mk" $> Make) <*> path
3131
pMerge :: Parser Command
3232
pMerge = (command "mg" $> Merge) <*> path
3333

34-
pList :: Parser Command
35-
pList = command "ls" $> ListOut
36-
3734
pTag :: Parser Command
3835
pTag = (commandFrom ["tag", "t"] $> Tag) <*> path <*> path
3936

@@ -91,17 +88,16 @@ pEdit = command "vi" $> Edit
9188
pBack :: Parser Command
9289
pBack = (command "back" $> Back) <*> number
9390

94-
pV2Path :: Parser Command
95-
pV2Path = (commandFrom ["debug-v2-path", "v2"] $> V2Path) <*> pPath
91+
pPreview :: Parser Command
92+
pPreview = (commandFrom ["preview", "ls"] $> Preview) <*> option Wild pPath
9693

9794
pCommandTerm :: Parser Command
9895
pCommandTerm =
9996
try pChangeNode
100-
<|> try pV2Path
97+
<|> try pPreview
10198
<|> try pDualize
10299
<|> try pMake
103100
<|> try pMerge
104-
<|> try pList
105101
<|> try pTag
106102
<|> try pText
107103
<|> try pDescribe

0 commit comments

Comments
 (0)