# frozen_string_literal: true require "thor" module Boilercode module Commands class Bookmarks < Thor namespace :bookmarks desc "search QUERY", "Search through your bookmarks and add selected bookmark to clipboard" method_option :help, aliases: "-h", type: :boolean, desc: "Display usage information" def search if options[:help] invoke :help, ["search"] else require_relative "bookmarks/search" Boilercode::Commands::Bookmarks::Search.new(options).execute end end desc "create", "Takes URL from clipboard and saves it to your BoilerCode bookmarks" method_option :help, aliases: "-h", type: :boolean, desc: "Display usage information" def create(*) if options[:help] invoke :help, ["create"] else require_relative "bookmarks/create" Boilercode::Commands::Bookmarks::Create.new(options).execute end end end end end