on develop help sign in
Adding spec name for pretty generator output
commit16e558f74ef604279c6c1b3470ae50645935ffd8 authorBrendan Hay <brendan.g.hay@gmail.com> dateTue 22 Sep 2015, 13:12 (11 years ago) parentd175b11
2 files changed+6−5
gen/src/Gen/Types.hs+4−3 gen/src/Main.hs+2−2
gen/src/Gen/Types.hs+4−3
@@ -54,18 +54,19 @@ data Versions = Versions
5454-- FIXME: need a more comprehensive 'vm_alpha' vs 'vm1.1' etc check.
5555data Spec = Spec
5656 { _specName :: Text
57+ , _specPrefix :: Text
5758 , _specVersion :: Text
5859 , _specPath :: Path
5960 }
6061
6162instance Eq Spec where
62− (==) = on (==) _specName
63+ (==) = on (==) _specPrefix
6364
6465instance Ord Spec where
65− compare a b = on compare _specName a b <> on compare _specVersion a b
66+ compare a b = on compare _specPrefix a b <> on compare _specVersion a b
6667
6768specFromPath :: Path -> Spec
68−specFromPath x = Spec (n <> v) v x
69+specFromPath x = Spec (n <> v) p v x
6970 where
7071 n = Text.intercalate "/"
7172 . drop 1
gen/src/Main.hs+2−2
@@ -128,9 +128,9 @@ main = do
128128 say ("Found " % int % " model specifications.") (length _optModels)
129129 say ("Selected " % int % " newest models.") (length ss)
130130
131− forM_ (zip [1..] ss) $ \(j, Spec n _ f) -> do
131+ forM_ (zip [1..] ss) $ \(j, s) -> do
132132 title ("[" % int % "/" % int % "] model:" % stext)
133− (j :: Int) (length ss) n
133+ (j :: Int) (length ss) (_specName s)
134134
135135 -- m <- listDir f >>= hoistEither . loadModel f
136136