mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-12-22 22:06:29 +00:00
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
7c33cb7d95
commit
fcacdf01e7
3 changed files with 23 additions and 2 deletions
3
Makefile
3
Makefile
|
@ -2,11 +2,10 @@
|
|||
BUILD := gomtree
|
||||
BUILDPATH := github.com/vbatts/go-mtree/cmd/gomtree
|
||||
CWD := $(shell pwd)
|
||||
SOURCE_FILES := $(shell find . -type f -name "*.go")
|
||||
SOURCE_FILES = $(shell find . -type f -name "*.go")
|
||||
CLEAN_FILES := *~
|
||||
TAGS :=
|
||||
ARCHES := linux,386 linux,amd64 linux,arm linux,arm64 linux,mips64 linux,riscv64 openbsd,amd64 windows,amd64 windows,arm64 darwin,amd64 darwin,arm64
|
||||
GO_VER := go1.14
|
||||
|
||||
default: build validation
|
||||
|
||||
|
|
21
cmd/gomtree/cmd/reformat.go
Normal file
21
cmd/gomtree/cmd/reformat.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
cli "github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
func NewMtree2JsonCommand() *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "mtree2json,",
|
||||
Usage: "represent an mtree as JSON format",
|
||||
Aliases: []string{"m2j"},
|
||||
Action: validateAction,
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringSliceFlag{
|
||||
Name: "file",
|
||||
Aliases: []string{"f"},
|
||||
Usage: "Directory hierarchy spec to validate",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -42,6 +42,7 @@ to support xattrs and interacting with tar archives.`
|
|||
}
|
||||
app.Commands = []*cli.Command{
|
||||
cmd.NewValidateCommand(),
|
||||
cmd.NewMtree2JsonCommand(),
|
||||
}
|
||||
|
||||
// Unfortunately urfave/cli is not at good at using DefaultCommand
|
||||
|
|
Loading…
Reference in a new issue