dotar/bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/wordpress-post

27 lines
928 B
Ruby
Executable File

#!/usr/bin/env ruby
$:.unshift(File.dirname(__FILE__) + "/../../lib")
require 'git-style-binary/command'
GitStyleBinary.command do
short_desc "create a blog post"
banner <<-EOS
SYNOPSIS
#{command.full_name} #{all_options_string} {content|STDIN}
EOS
opt :blog, "short name of the blog to use", :default => 'default'
opt :category, "tag/category. specify multiple times for multiple categories", :type => String, :multi => true
opt :title, "title for the post", :required => true, :type => String
opt :type, "type of the content [html|xhtml|text]", :default => 'html', :type => String
run do |command|
command.die :type, "type must be one of [html|xhtml|text]" unless command.opts[:type] =~ /^(x?html|text)$/i
puts "Subcommand name: #{command.name.inspect}"
puts "Options: #{command.opts.inspect}"
puts "Remaining arguments: #{command.argv.inspect}"
end
end