Module: Ubiquitously::Command::Post::Opts

Defined in:
lib/ubiquitously/commands/post.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



82
83
84
85
86
# File 'lib/ubiquitously/commands/post.rb', line 82

def description
  on('-d', '--description DESCRIPTION', "Post description (required)") do |description|
    options[:description] = description
  end
end

#helpObject



100
101
102
103
104
# File 'lib/ubiquitously/commands/post.rb', line 100

def help
  on_tail("-h", "--help", "Show this message") do
    exit
  end
end

#options(value = nil) ⇒ Object



52
53
54
55
# File 'lib/ubiquitously/commands/post.rb', line 52

def options(value = nil)
  @options = value if value
  @options
end

#passwordObject



94
95
96
97
98
# File 'lib/ubiquitously/commands/post.rb', line 94

def password
  on('-P', '--password [password]', "Password for service") do |password|
    options[:password] = password
  end
end

#section(heading, &block) ⇒ Object



57
58
59
60
61
62
# File 'lib/ubiquitously/commands/post.rb', line 57

def section(heading, &block)
  separator ""
  separator heading
  
  instance_eval(&block)
end

#tagsObject



76
77
78
79
80
# File 'lib/ubiquitously/commands/post.rb', line 76

def tags
  on('-t', '--tags TAGS', "Post tags (required)") do |tags|
    options[:tags] = tags.split(/,(?:\s+)?/)
  end
end

#titleObject



70
71
72
73
74
# File 'lib/ubiquitously/commands/post.rb', line 70

def title
  on('-l', '--title TITLE', "Post title (required)") do |title|
    options[:title] = title
  end
end

#urlObject



64
65
66
67
68
# File 'lib/ubiquitously/commands/post.rb', line 64

def url
  on('-u', '--url URL', "Post url (required)") do |url|
    options[:url] = url
  end
end

#usernameObject



88
89
90
91
92
# File 'lib/ubiquitously/commands/post.rb', line 88

def username
  on('-U', '--username [username]', "Username for service") do |username|
    options[:username] = username
  end
end