module Rbnotes::Commands ## # Shows the content of the notes specified by arguments. Each # argument must be a string which can be converted into # Textrepo::Timestamp object. # # A string for Textrepo::Timestamp must be: # # "20201106112600" : year, date, time and sec # "20201106112600_012" : with suffix # # If no argument is passed, reads the standard input for arguments. class Show < Command def description # :nodoc: "Show the content of notes" end def execute(args, conf) stamps = Rbnotes.utils.read_multiple_timestamps(args) repo = Textrepo.init(conf) content = stamps.map { |stamp| [stamp, repo.read(stamp)] }.to_h pager = conf[:pager] unless pager.nil? puts_with_pager(pager, make_output(content)) else puts make_output(content) end end def help # :nodoc: puts <