Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
soywod committed Jan 1, 2020
1 parent 6cdd672 commit e5f2d43
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.3] - 2020-01-01

### Added

- Add colors #4

## [0.3.2] - 2019-12-30

### Added
Expand Down Expand Up @@ -113,7 +119,8 @@ First release :tada:

- Linux binaries

[unreleased]: https://github.com/unfog-io/unfog-cli/compare/v0.3.2...HEAD
[unreleased]: https://github.com/unfog-io/unfog-cli/compare/v0.3.3...HEAD
[0.3.3]: https://github.com/unfog-io/unfog-cli/compare/v0.3.2...v0.3.3
[0.3.2]: https://github.com/unfog-io/unfog-cli/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/unfog-io/unfog-cli/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/unfog-io/unfog-cli/compare/v0.2.2...v0.3.0
Expand All @@ -129,6 +136,7 @@ First release :tada:
[#1]: https://github.com/unfog-io/unfog-cli/issues/1
[#2]: https://github.com/unfog-io/unfog-cli/issues/2
[#3]: https://github.com/unfog-io/unfog-cli/issues/3
[#4]: https://github.com/unfog-io/unfog-cli/issues/4
[#5]: https://github.com/unfog-io/unfog-cli/issues/5
[#6]: https://github.com/unfog-io/unfog-cli/issues/6
[#8]: https://github.com/unfog-io/unfog-cli/issues/8
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: unfog
version: 0.3.2
version: 0.3.3
github: "unfog-io/unfog-cli"
license: BSD3
author: "Clément DOUIN"
Expand Down
15 changes: 4 additions & 11 deletions src/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,8 @@ execute args state events query = do
let fByTags = filterByTags ctx
let fByDone = filterByDone $ "done" `elem` ctx
let tasks = mapWithWtime now . fByTags . fByDone $ _tasks state
case rtype of
JSON -> printTasks JSON tasks
Text -> do
putStrLn $ "unfog: list" ++ if null ctx
then ""
else " [" ++ unwords ctx ++ "]"
putStrLn ""
printTasks Text tasks
putStrLn ""
let ctxStr = if null ctx then "" else " [" ++ unwords ctx ++ "]"
printTasks rtype ("unfog: list " ++ ctxStr) tasks

ShowTask args -> do
now <- getCurrentTime
Expand All @@ -74,7 +67,7 @@ execute args state events query = do
let maybeTask = fByNumber . fByTags . fByDone $ _tasks state
case maybeTask of
Nothing -> printErr rtype $ "show: task [" ++ show id ++ "] not found"
Just task -> printTask rtype $ task { _wtime = getTotalWtime now task }
Just task -> printTask rtype task { _wtime = getTotalWtime now task }

ShowWtime args -> do
now <- getCurrentTime
Expand Down Expand Up @@ -105,6 +98,6 @@ execute args state events query = do
putStrLn "help"
putStrLn "version"

ShowVersion -> printVersion rtype "0.3.2"
ShowVersion -> printVersion rtype "0.3.3"

Error command message -> printErr rtype $ command ++ ": " ++ message
14 changes: 9 additions & 5 deletions src/Response.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,20 @@ printMsg rtype msg = case rtype of
JSON -> BL.putStr $ encode $ ResponseMsg msg
Text -> putStrLn $ "unfog: " ++ msg

printTasks :: ResponseType -> String -> [Task] -> IO ()
printTasks rtype msg tasks = case rtype of
JSON -> BL.putStr $ encode $ ResponseTasks tasks
Text -> do
putStrLn msg
putStrLn ""
prettyPrintTasks tasks
putStrLn ""

printTask :: ResponseType -> Task -> IO ()
printTask rtype task = case rtype of
JSON -> BL.putStr $ encode $ ResponseTask task
Text -> prettyPrintTasks [task]

printTasks :: ResponseType -> [Task] -> IO ()
printTasks rtype tasks = case rtype of
JSON -> BL.putStr $ encode $ ResponseTasks tasks
Text -> prettyPrintTasks tasks

printWtime :: ResponseType -> String -> [DailyWtime] -> IO ()
printWtime rtype msg wtime = case rtype of
JSON -> BL.putStr $ encode $ ResponseWtime wtime
Expand Down

0 comments on commit e5f2d43

Please sign in to comment.