findkeys: Support --largerthan and --smallerthan
Sponsored-by: Brett Eisenberg on Patreon
This commit is contained in:
parent
ab59b618c2
commit
f3f864fc6d
4 changed files with 21 additions and 1 deletions
|
@ -20,6 +20,7 @@ git-annex (10.20230927) UNRELEASED; urgency=medium
|
||||||
* Fix bug in git-annex copy --from --to that skipped files that were
|
* Fix bug in git-annex copy --from --to that skipped files that were
|
||||||
locally present.
|
locally present.
|
||||||
* Make git-annex copy --from --to --fast actually fast.
|
* Make git-annex copy --from --to --fast actually fast.
|
||||||
|
* findkeys: Support --largerthan and --smallerthan.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Tue, 10 Oct 2023 13:17:31 -0400
|
-- Joey Hess <id@joeyh.name> Tue, 10 Oct 2023 13:17:31 -0400
|
||||||
|
|
||||||
|
|
|
@ -266,6 +266,7 @@ annexedMatchingOptions = concat
|
||||||
keyMatchingOptions :: [AnnexOption]
|
keyMatchingOptions :: [AnnexOption]
|
||||||
keyMatchingOptions = concat
|
keyMatchingOptions = concat
|
||||||
[ keyMatchingOptions'
|
[ keyMatchingOptions'
|
||||||
|
, sizeMatchingOptions Limit.LimitAnnexFiles
|
||||||
, anythingNothingOptions
|
, anythingNothingOptions
|
||||||
, combiningOptions
|
, combiningOptions
|
||||||
, timeLimitOption
|
, timeLimitOption
|
||||||
|
@ -398,7 +399,11 @@ fileMatchingOptions' lb =
|
||||||
<> help "limit to files whose content is the same as another file matching the glob pattern"
|
<> help "limit to files whose content is the same as another file matching the glob pattern"
|
||||||
<> hidden
|
<> hidden
|
||||||
)
|
)
|
||||||
, annexOption (setAnnexState . Limit.addLargerThan lb) $ strOption
|
] ++ sizeMatchingOptions lb
|
||||||
|
|
||||||
|
sizeMatchingOptions :: Limit.LimitBy -> [AnnexOption]
|
||||||
|
sizeMatchingOptions lb =
|
||||||
|
[ annexOption (setAnnexState . Limit.addLargerThan lb) $ strOption
|
||||||
( long "largerthan" <> metavar paramSize
|
( long "largerthan" <> metavar paramSize
|
||||||
<> help "match files larger than a size"
|
<> help "match files larger than a size"
|
||||||
<> hidden
|
<> hidden
|
||||||
|
|
|
@ -46,3 +46,5 @@ as if I have misspelled the option:
|
||||||
|
|
||||||
I am using it for my research project (data science/predictions in plant breeding) and it allows me to keep track of the
|
I am using it for my research project (data science/predictions in plant breeding) and it allows me to keep track of the
|
||||||
current model iteration and associated results. Thank you for this!
|
current model iteration and associated results. Thank you for this!
|
||||||
|
|
||||||
|
> [[fixed|done]] --[[Joey]]
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
[[!comment format=mdwn
|
||||||
|
username="joey"
|
||||||
|
subject="""comment 1"""
|
||||||
|
date="2023-11-28T15:48:09Z"
|
||||||
|
content="""
|
||||||
|
Not all options in git-annex-matching-options can be used by findkeys. It
|
||||||
|
mentions this when it says "Some of these options can also be used by
|
||||||
|
commands to specify which keys they act on."
|
||||||
|
|
||||||
|
However in this case, --largerthan and --smallerthan could in fact be made
|
||||||
|
to operate on keys, and I've done so.
|
||||||
|
"""]]
|
Loading…
Add table
Add a link
Reference in a new issue