aboutsummaryrefslogtreecommitdiff
path: root/CmdLine/Option.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-03-22 10:42:38 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-03-22 14:12:19 -0400
commit35419994e9418444dc82e5c90c579203cc4c3616 (patch)
tree0d4374fbc7f233cfa409e9e142b36f00d12f71f4 /CmdLine/Option.hs
parentf2a5858f85f1d6e999d707f4b48cd2ea643197bc (diff)
add desktop notifications
Motivation: Hook scripts for nautilus or other file managers need to provide the user with feedback that a file is being downloaded. This commit was sponsored by THM Schoemaker.
Diffstat (limited to 'CmdLine/Option.hs')
-rw-r--r--CmdLine/Option.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/CmdLine/Option.hs b/CmdLine/Option.hs
index 915b06849..ce44d2ace 100644
--- a/CmdLine/Option.hs
+++ b/CmdLine/Option.hs
@@ -20,6 +20,7 @@ import System.Console.GetOpt
import Common.Annex
import qualified Annex
import Types.Messages
+import Types.DesktopNotify
import Limit
import CmdLine.Usage
@@ -41,6 +42,10 @@ commonOptions =
"don't show debug messages"
, Option ['b'] ["backend"] (ReqArg setforcebackend paramName)
"specify key-value backend to use"
+ , Option [] ["notify-finish"] (NoArg (setdesktopnotify mkNotifyFinish))
+ "show desktop notification after transfer finishes"
+ , Option [] ["notify-start"] (NoArg (setdesktopnotify mkNotifyStart))
+ "show desktop notification after transfer completes"
]
where
setforce v = Annex.changeState $ \s -> s { Annex.force = v }
@@ -49,6 +54,7 @@ commonOptions =
setforcebackend v = Annex.changeState $ \s -> s { Annex.forcebackend = Just v }
setdebug = Annex.changeGitConfig $ \c -> c { annexDebug = True }
unsetdebug = Annex.changeGitConfig $ \c -> c { annexDebug = False }
+ setdesktopnotify v = Annex.changeState $ \s -> s { Annex.desktopnotify = Annex.desktopnotify s <> v }
matcherOptions :: [Option]
matcherOptions =