diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-10-10 15:21:54 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-10-10 15:21:54 -0400 |
| commit | de2c8133aa2cf694f16fc5732e841af0991125bb (patch) | |
| tree | 42616e3ffe121eec26d0942186034af6c1d1bcc9 /src | |
| parent | 63d653ee19b0f1bf2f4115d9f4ae9a93b00bae90 (diff) | |
example for withOS
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property.hs | 7 |
1 files changed, 6 insertions, 1 deletions
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 |
