Skip to content

Commit 92351f1

Browse files
committed
v1.1.8 - Flag to output non-skip file only to shorten output
1 parent 934820b commit 92351f1

6 files changed

Lines changed: 8 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,5 @@
4646
- v1.1.7
4747
- Fix `getDirFile`
4848
- Update `go-helper/v2`
49+
- v1.1.8
50+
- Flag to output non-skip file only to shorten output

cmd/root.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ func init() {
7171
os.Exit(1)
7272
}
7373
rootCmd.PersistentFlags().BoolVarP(&global.Flag.Debug, "debug", "d", false, "Enable debug")
74+
rootCmd.PersistentFlags().BoolVarP(&global.Flag.NonSkip, "show-non-skip", "s", false, "Output non-skip only")
7475
rootCmd.PersistentFlags().BoolVarP(&global.Flag.Trace, "trace", "t", false, "Enable trace")
7576
rootCmd.PersistentFlags().BoolVarP(&global.Flag.Verbose, "verbose", "v", false, "Verbose")
7677
rootCmd.PersistentFlags().StringVarP(&global.Conf.FileConf, "config", "c", lib.Default.FileConf, "Config file")

cmd/update.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ var updateCmd = &cobra.Command{
3838
DirDest: &global.Conf.DirDest,
3939
DirSkip: &global.Conf.DirSkip,
4040
FileSkip: &global.Conf.FileSkip,
41+
NonSkip: global.Flag.NonSkip,
4142
Verbose: global.Flag.Verbose,
4243
}
4344

global/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ THE SOFTWARE.
2323
package global
2424

2525
const (
26-
Version = "v1.1.7"
26+
Version = "v1.1.8"
2727
)

lib/dotfile.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ type TypeDotfileProperty struct {
5151
DirSrc *string `json:"DirSrc"`
5252
FileSkip *[]string `json:"FileSkip"`
5353
Mode FileProcMode `json:"Mode"`
54+
NonSkip bool `json:"NonSkip"`
5455
Verbose bool `json:"Verbose"`
5556
}
5657

@@ -155,7 +156,7 @@ func (t *TypeDotfile) processFile(src, dest string) (err error) {
155156
}
156157

157158
if err == nil {
158-
if ezlog.GetLogLevel() >= ezlog.DEBUG || t.Verbose {
159+
if ezlog.GetLogLevel() >= ezlog.DEBUG || t.Verbose || t.NonSkip && fileProcMode != SKIP {
159160
str := fmt.Sprintf("%-6s %s %s -> %s", fileProcMode.String(), filePermStr, src, dest)
160161
ezlog.Log().M(str).Out()
161162
}

lib/flag.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ package lib
2525
// Holding all flags from command line
2626
type TypeFlag struct {
2727
Debug bool // Enable debug output
28+
NonSkip bool // Show non-skip
2829
Trace bool // Enable trace output
2930
Verbose bool
3031
}

0 commit comments

Comments
 (0)