new section for metadata
This commit is contained in:
parent
39ebfa1a2e
commit
e7672f197e
6 changed files with 42 additions and 38 deletions
|
@ -18,7 +18,7 @@ import Data.Time.Clock.POSIX
|
||||||
|
|
||||||
def :: [Command]
|
def :: [Command]
|
||||||
def = [withOptions [setOption] $ command "metadata" paramPaths seek
|
def = [withOptions [setOption] $ command "metadata" paramPaths seek
|
||||||
SectionUtility "sets metadata of a file"]
|
SectionMetaData "sets metadata of a file"]
|
||||||
|
|
||||||
setOption :: Option
|
setOption :: Option
|
||||||
setOption = Option ['s'] ["set"] (ReqArg mkmod "FIELD[+-]=VALUE") "set metadata"
|
setOption = Option ['s'] ["set"] (ReqArg mkmod "FIELD[+-]=VALUE") "set metadata"
|
||||||
|
|
|
@ -15,7 +15,7 @@ import Command.View (paramView, parseViewParam, checkoutViewBranch)
|
||||||
|
|
||||||
def :: [Command]
|
def :: [Command]
|
||||||
def = [notBareRepo $ notDirect $
|
def = [notBareRepo $ notDirect $
|
||||||
command "vadd" paramView seek SectionUtility "refine current view"]
|
command "vadd" paramView seek SectionMetaData "refine current view"]
|
||||||
|
|
||||||
seek :: CommandSeek
|
seek :: CommandSeek
|
||||||
seek = withWords start
|
seek = withWords start
|
||||||
|
|
|
@ -18,7 +18,7 @@ import Command.View (checkoutViewBranch)
|
||||||
|
|
||||||
def :: [Command]
|
def :: [Command]
|
||||||
def = [notBareRepo $ notDirect $
|
def = [notBareRepo $ notDirect $
|
||||||
command "vpop" (paramOptional paramNumber) seek SectionUtility
|
command "vpop" (paramOptional paramNumber) seek SectionMetaData
|
||||||
"switch back to previous view"]
|
"switch back to previous view"]
|
||||||
|
|
||||||
seek :: CommandSeek
|
seek :: CommandSeek
|
||||||
|
|
|
@ -20,7 +20,7 @@ import Logs.View
|
||||||
|
|
||||||
def :: [Command]
|
def :: [Command]
|
||||||
def = [notBareRepo $ notDirect $
|
def = [notBareRepo $ notDirect $
|
||||||
command "view" paramView seek SectionUtility "enter a view branch"]
|
command "view" paramView seek SectionMetaData "enter a view branch"]
|
||||||
|
|
||||||
seek :: CommandSeek
|
seek :: CommandSeek
|
||||||
seek = withWords start
|
seek = withWords start
|
||||||
|
|
|
@ -66,6 +66,7 @@ data CommandSection
|
||||||
| SectionSetup
|
| SectionSetup
|
||||||
| SectionMaintenance
|
| SectionMaintenance
|
||||||
| SectionQuery
|
| SectionQuery
|
||||||
|
| SectionMetaData
|
||||||
| SectionUtility
|
| SectionUtility
|
||||||
| SectionPlumbing
|
| SectionPlumbing
|
||||||
deriving (Eq, Ord, Enum, Bounded)
|
deriving (Eq, Ord, Enum, Bounded)
|
||||||
|
@ -75,5 +76,6 @@ descSection SectionCommon = "Commonly used commands"
|
||||||
descSection SectionSetup = "Repository setup commands"
|
descSection SectionSetup = "Repository setup commands"
|
||||||
descSection SectionMaintenance = "Repository maintenance commands"
|
descSection SectionMaintenance = "Repository maintenance commands"
|
||||||
descSection SectionQuery = "Query commands"
|
descSection SectionQuery = "Query commands"
|
||||||
|
descSection SectionMetaData = "Metadata commands"
|
||||||
descSection SectionUtility = "Utility commands"
|
descSection SectionUtility = "Utility commands"
|
||||||
descSection SectionPlumbing = "Plumbing commands"
|
descSection SectionPlumbing = "Plumbing commands"
|
||||||
|
|
|
@ -313,39 +313,6 @@ subdirectories).
|
||||||
from a remote computer.
|
from a remote computer.
|
||||||
Note that this does not yet use HTTPS for security, so use with caution!
|
Note that this does not yet use HTTPS for security, so use with caution!
|
||||||
|
|
||||||
* `view [field=value ...] [tag ...]`
|
|
||||||
|
|
||||||
Uses metadata to build a view branch of the files in the current branch,
|
|
||||||
and checks out the view branch. Only files in the current branch whose
|
|
||||||
metadata matches all the specified field values and tags will be
|
|
||||||
shown in the view.
|
|
||||||
|
|
||||||
Multiple values for a metadata field can be specified, either by using
|
|
||||||
a glob (field="\*") or by listing each wanted value. The resulting view
|
|
||||||
will put files in subdirectories according to the value of their fields.
|
|
||||||
|
|
||||||
Once within a view, you can make additional subdirectories, and
|
|
||||||
copy or move files into them. When you commit, the metadata will
|
|
||||||
be updated to correspond to your changes.
|
|
||||||
|
|
||||||
* `vpop [N]`
|
|
||||||
|
|
||||||
Switches from the currently active view back to the previous view.
|
|
||||||
Or, from the first view back to original branch.
|
|
||||||
|
|
||||||
The optional number tells how many views to pop.
|
|
||||||
|
|
||||||
* `vadd [field=value ...] [tag ...]`
|
|
||||||
|
|
||||||
Refines the currently checked out view branch, adding additional fields
|
|
||||||
or tags.
|
|
||||||
|
|
||||||
* `vcycle`
|
|
||||||
|
|
||||||
When a view involves nested subdirectories, this cycles the order.
|
|
||||||
For example, when the view has date/author/tag, vcycle will switch
|
|
||||||
it to author/tag/date.
|
|
||||||
|
|
||||||
# REPOSITORY SETUP COMMANDS
|
# REPOSITORY SETUP COMMANDS
|
||||||
|
|
||||||
* `init [description]`
|
* `init [description]`
|
||||||
|
@ -726,7 +693,7 @@ subdirectories).
|
||||||
Note that this subcommand can be used to graph any git repository; it
|
Note that this subcommand can be used to graph any git repository; it
|
||||||
is not limited to git-annex repositories.
|
is not limited to git-annex repositories.
|
||||||
|
|
||||||
# UTILITY COMMANDS
|
# METADATA COMMANDS
|
||||||
|
|
||||||
* `metadata [path ...] [-s field=value -s field+=value -s field-=value ...]`
|
* `metadata [path ...] [-s field=value -s field+=value -s field-=value ...]`
|
||||||
|
|
||||||
|
@ -745,6 +712,41 @@ subdirectories).
|
||||||
|
|
||||||
git annex metadata annexscreencast.ogv -s tag+=video -s tag+=screencast
|
git annex metadata annexscreencast.ogv -s tag+=video -s tag+=screencast
|
||||||
|
|
||||||
|
* `view [field=value ...] [tag ...]`
|
||||||
|
|
||||||
|
Uses metadata to build a view branch of the files in the current branch,
|
||||||
|
and checks out the view branch. Only files in the current branch whose
|
||||||
|
metadata matches all the specified field values and tags will be
|
||||||
|
shown in the view.
|
||||||
|
|
||||||
|
Multiple values for a metadata field can be specified, either by using
|
||||||
|
a glob (field="\*") or by listing each wanted value. The resulting view
|
||||||
|
will put files in subdirectories according to the value of their fields.
|
||||||
|
|
||||||
|
Once within a view, you can make additional subdirectories, and
|
||||||
|
copy or move files into them. When you commit, the metadata will
|
||||||
|
be updated to correspond to your changes.
|
||||||
|
|
||||||
|
* `vpop [N]`
|
||||||
|
|
||||||
|
Switches from the currently active view back to the previous view.
|
||||||
|
Or, from the first view back to original branch.
|
||||||
|
|
||||||
|
The optional number tells how many views to pop.
|
||||||
|
|
||||||
|
* `vadd [field=value ...] [tag ...]`
|
||||||
|
|
||||||
|
Refines the currently checked out view branch, adding additional fields
|
||||||
|
or tags.
|
||||||
|
|
||||||
|
* `vcycle`
|
||||||
|
|
||||||
|
When a view involves nested subdirectories, this cycles the order.
|
||||||
|
For example, when the view has date/author/tag, vcycle will switch
|
||||||
|
it to author/tag/date.
|
||||||
|
|
||||||
|
# UTILITY COMMANDS
|
||||||
|
|
||||||
* `migrate [path ...]`
|
* `migrate [path ...]`
|
||||||
|
|
||||||
Changes the specified annexed files to use the default key-value backend
|
Changes the specified annexed files to use the default key-value backend
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue