Change FileProgress callback to channel-based progress
Replace callback-based progress reporting in Builder.AddFile with channel-based FileHashProgress for consistency with EnumerateStatus and ScanStatus patterns. Update scanner.go to use the new channel API.
This commit is contained in:
@@ -117,10 +117,15 @@ func (mfa *CLIApp) run(args []string) {
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "output",
|
||||
Value: "./index.mf",
|
||||
Value: "./.index.mf",
|
||||
Aliases: []string{"o"},
|
||||
Usage: "Specify output filename",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "force",
|
||||
Aliases: []string{"f"},
|
||||
Usage: "Overwrite output file if it exists",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "progress",
|
||||
Aliases: []string{"P"},
|
||||
@@ -157,6 +162,41 @@ func (mfa *CLIApp) run(args []string) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "freshen",
|
||||
Usage: "Update manifest with changed, new, and removed files",
|
||||
ArgsUsage: "[manifest file]",
|
||||
Action: func(c *cli.Context) error {
|
||||
if !c.Bool("quiet") {
|
||||
mfa.printBanner()
|
||||
}
|
||||
mfa.setVerbosity(verbosity)
|
||||
return mfa.freshenManifestOperation(c)
|
||||
},
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "base",
|
||||
Aliases: []string{"b"},
|
||||
Value: ".",
|
||||
Usage: "Base directory for resolving relative paths",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "FollowSymLinks",
|
||||
Aliases: []string{"follow-symlinks"},
|
||||
Usage: "Resolve encountered symlinks",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "IgnoreDotfiles",
|
||||
Aliases: []string{"ignore-dotfiles"},
|
||||
Usage: "Ignore any dot (hidden) files encountered",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "progress",
|
||||
Aliases: []string{"P"},
|
||||
Usage: "Show progress during scanning and hashing",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "version",
|
||||
Usage: "Show version",
|
||||
|
||||
Reference in New Issue
Block a user