Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Enable --verbose for 'hackport diff'

  • Loading branch information...
commit a08b0e74e0c489ccc350372221cf6ede5efa77b0 1 parent a973398
Lennart Kolmodin kolmodin authored

Showing 1 changed file with 18 additions and 16 deletions. Show diff stats Hide diff stats

  1. +18 16 Main.hs
34 Main.hs
@@ -56,7 +56,7 @@ listCommand = CommandUI {
56 56
57 57 listAction :: () -> [String] -> GlobalFlags -> IO ()
58 58 listAction _ args globalFlags = do
59   - let verbose = fromFlag (globalVerbosity globalFlags)
  59 + let verbose = normal -- fromFlag (globalVerbosity globalFlags)
60 60 portDirM = flagToMaybe (globalOverlayPath globalFlags)
61 61 overlay <-
62 62 case portDirM of
@@ -106,21 +106,25 @@ makeEbuildCommand = CommandUI {
106 106 -----------------------------------------------------------------------
107 107
108 108 data DiffFlags = DiffFlags {
109   - diffMode :: Flag DiffMode
  109 + diffMode :: Flag DiffMode,
  110 + diffVerbosity :: Flag Verbosity
110 111 }
111 112
112 113 instance Monoid DiffFlags where
113 114 mempty = DiffFlags {
114   - diffMode = mempty
  115 + diffMode = mempty,
  116 + diffVerbosity = mempty
115 117 }
116 118 mappend a b = DiffFlags {
117   - diffMode = combine diffMode
  119 + diffMode = combine diffMode,
  120 + diffVerbosity = combine diffVerbosity
118 121 }
119 122 where combine field = field a `mappend` field b
120 123
121 124 defaultDiffFlags :: DiffFlags
122 125 defaultDiffFlags = DiffFlags {
123   - diffMode = Flag ShowAll
  126 + diffMode = Flag ShowAll,
  127 + diffVerbosity = Flag normal
124 128 }
125 129
126 130 diffCommand :: CommandUI DiffFlags
@@ -132,12 +136,13 @@ diffCommand = CommandUI {
132 136 commandUsage = usagePackages "diff",
133 137 commandDefaultFlags = defaultDiffFlags,
134 138 commandOptions = \showOrParseArgs ->
135   - []
  139 + [ optionVerbosity diffVerbosity (\v flags -> flags { diffVerbosity = v })
  140 + ]
136 141 }
137 142
138 143 diffAction :: DiffFlags -> [String] -> GlobalFlags -> IO ()
139 144 diffAction flags args globalFlags = do
140   - let verbose = fromFlag (globalVerbosity globalFlags)
  145 + let verbose = fromFlag (diffVerbosity flags)
141 146 overlayPath = fromFlag (globalOverlayPath globalFlags)
142 147 dm = fromFlag (diffMode flags)
143 148 runDiff verbose overlayPath dm
@@ -164,7 +169,7 @@ updateCommand = CommandUI {
164 169
165 170 updateAction :: Flag String -> [String] -> GlobalFlags -> IO ()
166 171 updateAction serverFlag args globalFlags = do
167   - let verbose = fromFlag (globalVerbosity globalFlags)
  172 + let verbose = normal -- fromFlag (globalVerbosity globalFlags)
168 173 server = fromFlag serverFlag
169 174 case parseURI server of
170 175 Just uri -> updateCache verbose uri
@@ -210,7 +215,7 @@ statusCommand = CommandUI {
210 215
211 216 statusAction :: StatusFlags -> [String] -> GlobalFlags -> IO ()
212 217 statusAction flags args globalFlags = do
213   - let verbose = fromFlag (globalVerbosity globalFlags)
  218 + let verbose = normal -- fromFlag (globalVerbosity globalFlags)
214 219 portDir = fromFlag (globalPortDir globalFlags)
215 220 overlayPath = fromFlag (globalOverlayPath globalFlags)
216 221 toPortDir = fromFlag (statusToPortage flags)
@@ -234,7 +239,7 @@ mergeCommand = CommandUI {
234 239
235 240 mergeAction :: Flag String -> [String] -> GlobalFlags -> IO ()
236 241 mergeAction serverFlag [pkg] globalFlags = do
237   - let verbose = fromFlag (globalVerbosity globalFlags)
  242 + let verbose = normal -- fromFlag (globalVerbosity globalFlags)
238 243 server = fromFlag serverFlag
239 244 case parseURI server of
240 245 Just uri -> merge verbose uri pkg
@@ -267,16 +272,14 @@ usageFlags name pname =
267 272 data GlobalFlags = GlobalFlags {
268 273 globalVersion :: Flag Bool,
269 274 globalOverlayPath :: Flag FilePath,
270   - globalPortDir :: Flag FilePath,
271   - globalVerbosity :: Flag Verbosity
  275 + globalPortDir :: Flag FilePath
272 276 }
273 277
274 278 defaultGlobalFlags :: GlobalFlags
275 279 defaultGlobalFlags = GlobalFlags {
276 280 globalVersion = Flag False,
277 281 globalOverlayPath = NoFlag,
278   - globalPortDir = NoFlag,
279   - globalVerbosity = Flag normal
  282 + globalPortDir = NoFlag
280 283 }
281 284
282 285 globalCommand :: CommandUI GlobalFlags
@@ -288,8 +291,7 @@ globalCommand = CommandUI {
288 291 commandUsage = \_ -> [],
289 292 commandDefaultFlags = defaultGlobalFlags,
290 293 commandOptions = \showOrParseArgs ->
291   - [ optionVerbosity globalVerbosity (\v flags -> flags { globalVerbosity = v })
292   - ]
  294 + [ ]
293 295 }
294 296
295 297 mainWorker :: [String] -> IO ()

0 comments on commit a08b0e7

Please sign in to comment.
Something went wrong with that request. Please try again.