lib/rbnotes/commands/list.rb in rbnotes-0.4.19 vs lib/rbnotes/commands/list.rb in rbnotes-0.4.20

- old
+ new

@@ -31,10 +31,11 @@ # - "yeasterday" (or "ye") # - "this_week" (or "tw") # - "last_week" (or "lw") # - "this_month" (or "tm") # - "last_month" (or "lm") + # - "recent" (or "re") # - "all" # # Here is several examples of timestamp patterns. # # "20201027093600_012": a complete string to represent a timestamp @@ -65,13 +66,15 @@ args << default_behavior end utils = Rbnotes.utils patterns = utils.read_timestamp_patterns(args, enum_week: @opts[:enum_week]) - repo = Textrepo.init(conf) - stamps = utils.find_notes(patterns, repo) + + num_of_notes = utils.specified_recent?(args) ? conf[:number_of_recent_notes] : 0 + stamps = utils.find_notes(patterns, repo, num_of_notes) + output = [] if @opts[:verbose] collect_timestamps_by_date(stamps).each { |date, timestamps| output << "#{date} (#{timestamps.size})" timestamps.each { |timestamp| @@ -144,12 +147,15 @@ - "yeasterday" (or "ye") - "this_week" (or "tw") - "last_week" (or "lw") - "this_month" (or "tm") - "last_month" (or "lm") + - "recent" (or "re") - "all" -The keyword, "all" specifies to enumerate all notes in the repository. +The keyword, "recent" specifies to enumerate recent notes in the +repository. The keyword, "all" specifies to enumerate all notes in +the repository. HELP end # :stopdoc: