find: Avoid polluting stdout with progress messages. Closes: #718186
This commit is contained in:
parent
433682cb1d
commit
9476355bc3
5 changed files with 13 additions and 2 deletions
|
@ -30,6 +30,7 @@ import Annex.Content
|
||||||
import Annex.Ssh
|
import Annex.Ssh
|
||||||
import Annex.Environment
|
import Annex.Environment
|
||||||
import Command
|
import Command
|
||||||
|
import Types.Messages
|
||||||
|
|
||||||
type Params = [String]
|
type Params = [String]
|
||||||
type Flags = [Annex ()]
|
type Flags = [Annex ()]
|
||||||
|
@ -47,6 +48,8 @@ dispatch fuzzyok allargs allcmds commonoptions fields header getgitrepo = do
|
||||||
checkEnvironment
|
checkEnvironment
|
||||||
checkfuzzy
|
checkfuzzy
|
||||||
forM_ fields $ uncurry Annex.setField
|
forM_ fields $ uncurry Annex.setField
|
||||||
|
when (cmdnomessages cmd) $
|
||||||
|
Annex.setOutput QuietOutput
|
||||||
sequence_ flags
|
sequence_ flags
|
||||||
whenM (annexDebug <$> Annex.getGitConfig) $
|
whenM (annexDebug <$> Annex.getGitConfig) $
|
||||||
liftIO enableDebugOutput
|
liftIO enableDebugOutput
|
||||||
|
|
|
@ -9,6 +9,7 @@ module Command (
|
||||||
command,
|
command,
|
||||||
noRepo,
|
noRepo,
|
||||||
noCommit,
|
noCommit,
|
||||||
|
noMessages,
|
||||||
withOptions,
|
withOptions,
|
||||||
next,
|
next,
|
||||||
stop,
|
stop,
|
||||||
|
@ -40,13 +41,18 @@ import Annex.CheckAttr
|
||||||
|
|
||||||
{- Generates a normal command -}
|
{- Generates a normal command -}
|
||||||
command :: String -> String -> [CommandSeek] -> CommandSection -> String -> Command
|
command :: String -> String -> [CommandSeek] -> CommandSection -> String -> Command
|
||||||
command = Command [] Nothing commonChecks False
|
command = Command [] Nothing commonChecks False False
|
||||||
|
|
||||||
{- Indicates that a command doesn't need to commit any changes to
|
{- Indicates that a command doesn't need to commit any changes to
|
||||||
- the git-annex branch. -}
|
- the git-annex branch. -}
|
||||||
noCommit :: Command -> Command
|
noCommit :: Command -> Command
|
||||||
noCommit c = c { cmdnocommit = True }
|
noCommit c = c { cmdnocommit = True }
|
||||||
|
|
||||||
|
{- Indicates that a command should not output anything other than what
|
||||||
|
- it directly sends to stdout. (--json can override this). -}
|
||||||
|
noMessages :: Command -> Command
|
||||||
|
noMessages c = c { cmdnomessages = True }
|
||||||
|
|
||||||
{- Adds a fallback action to a command, that will be run if it's used
|
{- Adds a fallback action to a command, that will be run if it's used
|
||||||
- outside a git repository. -}
|
- outside a git repository. -}
|
||||||
noRepo :: IO () -> Command -> Command
|
noRepo :: IO () -> Command -> Command
|
||||||
|
|
|
@ -20,7 +20,7 @@ import Types.Key
|
||||||
import qualified Option
|
import qualified Option
|
||||||
|
|
||||||
def :: [Command]
|
def :: [Command]
|
||||||
def = [noCommit $ withOptions [formatOption, print0Option] $
|
def = [noCommit $ noMessages $ withOptions [formatOption, print0Option] $
|
||||||
command "find" paramPaths seek SectionQuery "lists available files"]
|
command "find" paramPaths seek SectionQuery "lists available files"]
|
||||||
|
|
||||||
formatOption :: Option
|
formatOption :: Option
|
||||||
|
|
|
@ -39,6 +39,7 @@ data Command = Command
|
||||||
, cmdnorepo :: Maybe (IO ()) -- an action to run when not in a repo
|
, cmdnorepo :: Maybe (IO ()) -- an action to run when not in a repo
|
||||||
, cmdcheck :: [CommandCheck] -- check stage
|
, cmdcheck :: [CommandCheck] -- check stage
|
||||||
, cmdnocommit :: Bool -- don't commit journalled state changes
|
, cmdnocommit :: Bool -- don't commit journalled state changes
|
||||||
|
, cmdnomessages :: Bool -- don't output normal messages
|
||||||
, cmdname :: String
|
, cmdname :: String
|
||||||
, cmdparamdesc :: String -- description of params for usage
|
, cmdparamdesc :: String -- description of params for usage
|
||||||
, cmdseek :: [CommandSeek] -- seek stage
|
, cmdseek :: [CommandSeek] -- seek stage
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -31,6 +31,7 @@ git-annex (4.20130724) UNRELEASED; urgency=low
|
||||||
* Improve test suite on Windows; now tests git annex sync.
|
* Improve test suite on Windows; now tests git annex sync.
|
||||||
* Fix a few bugs involving filenames that are at or near the filesystem's
|
* Fix a few bugs involving filenames that are at or near the filesystem's
|
||||||
maximum filename length limit.
|
maximum filename length limit.
|
||||||
|
* find: Avoid polluting stdout with progress messages. Closes: #718186
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Tue, 23 Jul 2013 12:39:48 -0400
|
-- Joey Hess <joeyh@debian.org> Tue, 23 Jul 2013 12:39:48 -0400
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue