# encoding: utf-8 module GithubCLI class Commands::Labels < Command namespace :label desc 'list ', 'Listing all labels for this repository.' method_option :params, :type => :hash, :default => {}, :desc => 'Additonal request parameters e.i per_page:100' def list(user, repo) Label.all user, repo, options[:params], options[:format] end desc 'get ', 'Get a single label.' method_option :params, :type => :hash, :default => {}, :desc => 'Additonal request parameters e.i per_page:100' def get(user, repo, name) Label.get user, repo, name, options[:params], options[:format] end desc 'create ', 'Create a label.' long_desc <<-DESC Inputs name - Required string color - Required string - 6 character hex code, without leading # DESC method_option :params, :type => :hash, :default => {}, :desc => 'Additonal request parameters e.i per_page:100' def create(user, repo) Label.create user, repo, options[:params], options[:format] end desc 'update ', 'Update a label.' method_option :params, :type => :hash, :default => {}, :desc => 'Additonal request parameters e.i per_page:100' def update(user, repo, name) Label.update user, repo, name, options[:params], options[:format] end desc 'delete ', 'Delete a label.' method_option :params, :type => :hash, :default => {}, :desc => 'Additonal request parameters e.i per_page:100' def delete(user, repo, name) Label.delete user, repo, name, options[:params], options[:format] end desc 'issue ', 'List labels on an issue.' method_option :params, :type => :hash, :default => {}, :desc => 'Additonal request parameters e.i per_page:100' def issue(user, repo, number) Label.issue user, repo, number, options[:params], options[:format] end desc 'add ', 'Add labels to an issue.' method_option :labels, :type => :string, :desc => 'Labels to be added to this issue.' method_option :params, :type => :hash, :default => {}, :desc => 'Additional request parameters e.i per_page:100' def add(user, repo, number) Label.add user, repo, number, options[:labels], options[:params] end desc 'remove ', 'List labels on an issue.' method_option :name, :type => :string, :default => nil, :desc => 'Label name' method_option :params, :type => :hash, :default => {}, :desc => 'Additonal request parameters e.i per_page:100' def remove(user, repo, number) Label.issue user, repo, number, options[:name], options[:params], options[:format] end desc 'replace ', 'Replace all labels for an issue.' method_option :labels, :type => :string, :desc => 'Labels to be replace in this issue.' method_option :params, :type => :hash, :default => {}, :desc => 'Additonal request parameters e.i per_page:100' def replace(user, repo, number) Label.replace user, repo, number, options[:labels], options[:params] end desc 'milestone ', 'Get labels for every issue in a milestone.' method_option :params, :type => :hash, :default => {}, :desc => 'Additonal request parameters e.i per_page:100' def milestone(user, repo, number) Label.milestone user, repo, number, options[:params], options[:format] end end # Labels end # GithubCLI