mirror of
https://github.com/vbatts/go-mtree.git
synced 2025-06-28 04:58:28 +00:00
*: have gomtree always evaluate tar_time if it is present
if the keyword "tar_time" is present when evaluating an Entry, gomtree should use the tar_time when evaluating the "time" keyword as well. This commit also adds a test that makes sure "tar_time" wins against "time" if both are present. Some minor clean-ups as well, such as checking if KeywordFunc[keyword] actually retrieves a function. Signed-off-by: Stephen Chung <schung@redhat.com>
This commit is contained in:
parent
bc6f3bf902
commit
656e577ecc
7 changed files with 106 additions and 25 deletions
|
@ -94,7 +94,11 @@ func main() {
|
|||
currentKeywords = append([]string{"type"}, currentKeywords...)
|
||||
}
|
||||
} else {
|
||||
currentKeywords = mtree.DefaultKeywords[:]
|
||||
if *flTar != "" {
|
||||
currentKeywords = mtree.DefaultTarKeywords[:]
|
||||
} else {
|
||||
currentKeywords = mtree.DefaultKeywords[:]
|
||||
}
|
||||
}
|
||||
// -K <keywords>
|
||||
if *flAddKeywords != "" {
|
||||
|
@ -192,13 +196,9 @@ func main() {
|
|||
log.Println(err)
|
||||
isErr = true
|
||||
return
|
||||
if res != nil {
|
||||
if len(res.Failures) > 0 {
|
||||
defer os.Exit(1)
|
||||
for _, failure := range res.Failures {
|
||||
fmt.Println(failure)
|
||||
}
|
||||
}
|
||||
}
|
||||
if res != nil {
|
||||
if len(res.Extra) > 0 {
|
||||
defer os.Exit(1)
|
||||
for _, extra := range res.Extra {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue