From 1d546c93b19768a2a22f3948e7c4c39d5083e5d5 Mon Sep 17 00:00:00 2001 From: Tristan Ancelet Date: Fri, 24 May 2024 08:54:04 -0500 Subject: [PATCH] began changes --- bucket-tool | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/bucket-tool b/bucket-tool index 524dba2..8fa7d9f 100644 --- a/bucket-tool +++ b/bucket-tool @@ -14,15 +14,16 @@ Description: search the filebucket and restore from it. Actions: - search : Search for bucket entries matching a portion of the filepath - list : List all Bucket entries - list-files : List all files/paths that have been backed up to the bucket - get : Get the content of a specific entry (by hash) - restore : Restore previous state of file stored in bucket (by-hash) + search : Search for bucket entries matching a portion of the filepath + list : List all Bucket entries + list-files : List all files/paths that have been backed up to the bucket + get : Get the content of a specific entry (by hash) + restore-hash : Restore previous state of file stored in bucket (by-hash) + restore-file : Restore previous state of file stored in bucket (by-filepath/filename) Global Flags: - -d | --debug : Set debug flag - -h | --help : This help message + -d | --debug : Set debug flag + -h | --help : This help message Author: Name: Tristan Ancelet @@ -243,12 +244,7 @@ end def search_entries_paths (bucket) log "user entered" - bucket.entries.each_value do |entry| - log "checking Entry[#{entry.hash}]" - if entry.path_include? $CONFIG[:search_term] - puts entry.inline_info - end - end + puts bucket.entries.each_value.select {|entry| entry.path_include? $CONFIG[:search_term]}.map{|entry| entry.inline_info}.sort.join("\n") end def get_content_of_entry_hash (bucket)