Revision e247747c src/Ganeti/HTools/CLI.hs

b/src/Ganeti/HTools/CLI.hs
8 8

  
9 9
{-
10 10

  
11
Copyright (C) 2009, 2010, 2011, 2012 Google Inc.
11
Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
12 12

  
13 13
This program is free software; you can redistribute it and/or modify
14 14
it under the terms of the GNU General Public License as published by
......
82 82
  , oStdSpec
83 83
  , oTieredSpec
84 84
  , oVerbose
85
  , oPriority
85 86
  , genericOpts
86 87
  ) where
87 88

  
......
98 99
import Ganeti.HTools.Types
99 100
import Ganeti.BasicTypes
100 101
import Ganeti.Common as Common
102
import Ganeti.Types
101 103
import Ganeti.Utils
102 104

  
103 105
-- * Data types
......
143 145
  , optTieredSpec  :: Maybe RSpec    -- ^ Requested specs for tiered mode
144 146
  , optReplay      :: Maybe String   -- ^ Unittests: RNG state
145 147
  , optVerbose     :: Int            -- ^ Verbosity level
148
  , optPriority    :: Maybe OpSubmitPriority -- ^ OpCode submit priority
146 149
  } deriving Show
147 150

  
148 151
-- | Default values for the command line options.
......
187 190
  , optTieredSpec  = Nothing
188 191
  , optReplay      = Nothing
189 192
  , optVerbose     = 1
193
  , optPriority    = Nothing
190 194
  }
191 195

  
192 196
-- | Abbreviation for the option type.
......
518 522
   "increase the verbosity level",
519 523
   OptComplNone)
520 524

  
525
oPriority :: OptType
526
oPriority =
527
  (Option "" ["priority"]
528
   (ReqArg (\ inp opts -> do
529
              prio <- parseSubmitPriority inp
530
              Ok opts { optPriority = Just prio }) "PRIO")
531
   "set the priority of submitted jobs",
532
    OptComplChoices (map fmtSubmitPriority [minBound..maxBound]))
533

  
521 534
-- | Generic options.
522 535
genericOpts :: [GenericOptType Options]
523 536
genericOpts =  [ oShowVer

Also available in: Unified diff