Sha256: 2ca50030da152899148919bf1e30b9016fc19103c7b9b866e55c6dc3b98da765

Contents?: true

Size: 864 Bytes

Versions: 1

Compression:

Stored size: 864 Bytes

Contents

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

module Hackpad

  class Cli < Thor

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

    class_option :workspace,
      aliases: "-w",
      default: "default",
      desc: "Name of the workspace to use."

    default_task :help

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

    desc "getinfo [pad_id]", "gets info for the pad <pad_id>."
    def getinfo(pad)
      Hackpad::Client.new(options).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).show pad, format
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hackpad-cli-0.0.3 lib/hackpad/cli.rb