mirror of
https://github.com/maride/pancap.git
synced 2026-04-13 10:35:45 +00:00
Add file manager, storing extracted files
This commit is contained in:
@@ -5,11 +5,17 @@ import "flag"
|
||||
var (
|
||||
fullOutput *bool
|
||||
printEmptyBlocks *bool
|
||||
targetFiles *string
|
||||
targetAllFiles *bool
|
||||
targetOutput *string
|
||||
)
|
||||
|
||||
func RegisterFlags() {
|
||||
fullOutput = flag.Bool("full-output", false, "Show full output instead of limiting submodule output")
|
||||
printEmptyBlocks = flag.Bool("print-empty-blocks", false, "Prints blocks (submodule output) even if the submodule doesn't have any content to print.")
|
||||
targetFiles = flag.String("extract-these", "", "Comma-separated list of files to extract.")
|
||||
targetAllFiles = flag.Bool("extract-all", false, "Extract all files found.")
|
||||
targetOutput = flag.String("extract-to", "./extracted", "Directory to store extracted files in.")
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,4 +17,10 @@ func Finalize() {
|
||||
// We did - inform user about this
|
||||
printer.Println("Some submodule output was hidden. Add --print-empty-blocks to show it.")
|
||||
}
|
||||
|
||||
// Check if the user didn't use the file extract option, although there were files available to extract
|
||||
if extractedFiles == 0 && len(registeredFiles) > 0 {
|
||||
// User avoided the files
|
||||
printer.Println("Files found in stream. Add --extract-all or --extract-these <list> to extract them.")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user