Class: DK::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/draftking/cli/cli_options.rb

Overview

Options helper methods for CLI

Class Method Summary collapse

Class Method Details

.descriptions(array) ⇒ Object

String of operation descriptions



30
31
32
33
# File 'lib/draftking/cli/cli_options.rb', line 30

def self.descriptions(array)
  d = op_strings
  array.map { |opt| d[opt] || "not found #{opt}" }.join("\n\n")
end

.op_stringsObject

Define option descriptions



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/draftking/cli/cli_options.rb', line 5

def self.op_strings
  d = {}
  d[:add_tags]      = 'Comma separated string of tags to add.'
  d[:blog]          = 'Name of blog to use. Excluding this will default to main blog.'
  d[:comment]       = 'A caption that gets added to your posts.'
  d[:config]        = 'Name or # of Config to use (`dk accounts` for list)'
  d[:credit]        = 'Give draftking credit with a tag'
  d[:keep_comments] = 'Keep the previous comments on a post.'
  d[:keep_tags]     = 'Keep existing tags, in addition to newly generated tags.'
  d[:key_text]      = "Only apply command to posts who's comment contains the key_text string."
  d[:limit]         = 'Restrict number of posts selected.'
  d[:mute]          = 'Suppress progress messages.'
  d[:publish]       = 'Indicate that posts should be moved to the Published state.'
  d[:simulate]      = 'Simulation mode: Display program output without modifying actual Tumblr data.'
  d[:source]        = 'Modify posts from your : d-drafts, q-queue'
  d[:state]         = 'Set post state: d-draft, q-queued'
  d[:tags]          = 'Auto-Generate tags based on user comment.'
  d[:greedy]        = 'Select entire queue before processing the action.'
  d[:file]          = 'File path.'
  d[:link]          = 'URL to visit when photo is clicked.'
  d[:show_pi]       = 'Show progress indicators.'
  d
end