Adding 'yadr' command for managing plugins (wip)
This commit is contained in:
26
bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/wordpress-post
vendored
Executable file
26
bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/wordpress-post
vendored
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user