Sha256: 4d287bdb8da1fac88344637a92d2121d4c06da49c2d10c57bd79ecdd2dfa568a

Contents?: true

Size: 821 Bytes

Versions: 2

Compression:

Stored size: 821 Bytes

Contents

require "thor"
require "colorize"
require "yaml"
require_relative "client"

module Hackpad

  class Cli < Thor
    include Thor::Actions

    default_task :help

    class_option :configdir,
      aliases: "-c",
      banner: "PATH",
      default: File.join(ENV["HOME"], ".hackpad-cli/"),
      desc: "Path to the hackpad-cli directory to use"

    desc "list", "Lists available pads."
    def list
      Hackpad::Client.new(options[:configdir]).list
    end

    desc "getinfo [pad_id]", "gets info for the pad <pad_id>"
    def getinfo(pad)
      Hackpad::Client.new(options[:configdir]).getinfo pad
    end

    desc "show [pad_id] [format]", "shows pad <pad_id> in format [html,txt,md] (default txt)"
    def show(pad,format='txt')
      Hackpad::Client.new(options[:configdir]).show pad, format
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hackpad-cli-0.0.2 lib/hackpad/cli.rb
hackpad-cli-0.0.1 lib/hackpad/cli.rb