Permalink
Browse files

lsstory can show --all-iterations, --current-iteration, or an --itera…

…tion by start date.
  • Loading branch information...
mike-burns committed Dec 28, 2011
1 parent 23c80d7 commit da0d1e087f053c8f752089356da9a34774ccbdc6
Showing with 31 additions and 5 deletions.
  1. +29 −3 LsStory.hs
  2. +2 −2 README.md
View
@@ -143,11 +143,20 @@ neededFilter args
| showDevelopmentNeeded args = filter storyDevelopmentNeeded
| otherwise = id
-iterationFilter iterations args =
- filter ((currentIterationId ==) . storyIterationId)
+iterationFilter iterations args
+ | showAllIterations args = id
+ | showCurrentIteration args && (present $ showIteration args) =
+ filter (storyInIterations $ [currentIteration] ++ desiredIterations)
+ | present $ showIteration args = filter (storyInIterations desiredIterations)
+ | otherwise = filter (storyInIterations [currentIteration])
where
currentIteration = head $ filter iterationIsCurrent iterations
- currentIterationId = iterationId currentIteration
+ present = not . null
+ desiredIterations = filter (\iteration ->
+ (iterationStartsOn iteration) `elem` (showIteration args)
+ ) iterations
+ storyInIterations its story =
+ (storyIterationId story) `elem` (map iterationId its)
deletionsFilter args = filter (not . storyDeleted)
@@ -171,6 +180,10 @@ data LsStoryArg = LsStoryArg {
,showAccepted :: Bool
,showRejected :: Bool
+ ,showAllIterations :: Bool
+ ,showCurrentIteration :: Bool
+ ,showIteration :: [String]
+
,detailedOutput :: Bool
,onlyNext :: Bool
@@ -246,6 +259,19 @@ lsStoryArgDefinition = LsStoryArg {
&= explicit
&= name "rejected"
&= help "Stories which have been rejected"
+ ,showAllIterations = def
+ &= explicit
+ &= name "all-iterations"
+ &= groupname "Iteration filtering"
+ &= help "Stories from all iterations"
+ ,showCurrentIteration = def
+ &= explicit
+ &= name "current-iteration"
+ &= help "Stories from the current iteration"
+ ,showIteration = def
+ &= explicit
+ &= name "iteration"
+ &= help "Stories from the named iteration"
,onlyNext = def
&= explicit
&= name "next"
View
@@ -25,12 +25,12 @@ Done:
% lsstory --design
% lsstory --design --development
-To do:
-
% lsstory --all-iterations
% lsstory --current-iteration
% lsstory --iteration 2012-01-02
+To do:
+
% lsidea
% lsmilestone
% lsmilestone --unstarted --next

0 comments on commit da0d1e0

Please sign in to comment.