Permalink
Browse files

Enable --verbose for 'hackport status'

  • Loading branch information...
1 parent c4d52c5 commit 72143bad5db91fda932b0b9cbd68e7dfe8bc8e80 @kolmodin kolmodin committed Sep 1, 2008
Showing with 8 additions and 2 deletions.
  1. +8 −2 Main.hs
View
10 Main.hs
@@ -243,20 +243,24 @@ updateAction flags args globalFlags = do
-----------------------------------------------------------------------
data StatusFlags = StatusFlags {
+ statusVerbosity :: Flag Verbosity,
statusToPortage :: Flag Bool
}
instance Monoid StatusFlags where
mempty = StatusFlags {
+ statusVerbosity = mempty,
statusToPortage = mempty
}
mappend a b = StatusFlags {
+ statusVerbosity = combine statusVerbosity,
statusToPortage = combine statusToPortage
}
where combine field = field a `mappend` field b
defaultStatusFlags :: StatusFlags
defaultStatusFlags = StatusFlags {
+ statusVerbosity = Flag normal,
statusToPortage = Flag False
}
@@ -269,7 +273,9 @@ statusCommand = CommandUI {
commandUsage = usagePackages "status",
commandDefaultFlags = defaultStatusFlags,
commandOptions = \showOrParseArgs ->
- [option [] ["to-portage"]
+ [ optionVerbosity statusVerbosity (\v flags -> flags { statusVerbosity = v })
+
+ , option [] ["to-portage"]
"Print only packages likely to be interesting to move to the portage tree."
statusToPortage (\v flags -> flags { statusToPortage = v })
falseArg
@@ -278,7 +284,7 @@ statusCommand = CommandUI {
statusAction :: StatusFlags -> [String] -> GlobalFlags -> IO ()
statusAction flags args globalFlags = do
- let verbose = normal -- fromFlag (globalVerbosity globalFlags)
+ let verbose = fromFlag (statusVerbosity flags)
portDir = fromFlag (globalPortDir globalFlags)
overlayPath = fromFlag (globalOverlayPath globalFlags)
toPortDir = fromFlag (statusToPortage flags)

0 comments on commit 72143ba

Please sign in to comment.