From de2c8133aa2cf694f16fc5732e841af0991125bb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 10 Oct 2015 15:21:54 -0400 Subject: example for withOS --- src/Propellor/Property.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Propellor/Property.hs') diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index 667dc52b..342db1a5 100644 --- a/src/Propellor/Property.hs +++ b/src/Propellor/Property.hs @@ -173,7 +173,12 @@ trivial p = adjustPropertySatisfy p $ \satisfy -> do -- | Makes a property that is satisfied differently depending on the host's -- operating system. -- --- Note that the operating system may not be declared for some hosts. +-- Note that the operating system may not be declared for all hosts. +-- +-- > myproperty = withOS "foo installed" $ \o -> case o of +-- > (Just (System (Debian suite) arch)) -> ... +-- > (Just (System (Ubuntu release) arch)) -> ... +-- > Nothing -> ... withOS :: Desc -> (Maybe System -> Propellor Result) -> Property NoInfo withOS desc a = property desc $ a =<< getOS -- cgit v1.2.3