lib/github_cli/commands/organizations.rb in github_cli-0.5.9 vs lib/github_cli/commands/organizations.rb in github_cli-0.6.0
- old
+ new
@@ -8,19 +8,30 @@
desc 'list [--user=<name>]', 'List public and private organizations for the authenticated user'
method_option :user, :type => :string, :aliases => ["-u"],
:desc => 'List all public organizations for a user',
:banner => '<user>'
def list
- options[:params]['user'] = options[:user] if options[:user]
- Organization.list options[:params], options[:format]
+ global_options = options.dup
+ params = options[:params].dup
+ params['user'] = options[:user] if options[:user]
+ Util.hash_without!(global_options, params.keys + ['params'])
+ Organization.list params, global_options
end
desc 'get <org>', 'Get properties for a single organization'
def get(org)
- Organization.get org, options[:params], options[:format]
+ global_options = options.dup
+ params = options[:params].dup
+ Util.hash_without!(global_options, params.keys + ['params'])
+ Organization.get org, params, global_options
end
+ option :billing_email, :type => :string
+ option :company, :type => :string
+ option :email, :type => :string
+ option :location, :type => :string
+ option :name, :type => :string
desc 'edit <org>', 'Edit organization'
long_desc <<-DESC
Parameters
billing_email - Optional string - Billing email address. This address is not publicized.\n
@@ -29,13 +40,21 @@
location - Optional string\n
name - Optional string\n
Example
- ghc org edit rails --params=name:github company:GitHub email:support@github.com
+ gcli org edit rails --name=github --company=GitHub --email=support@github.com
DESC
def edit(org)
- Organization.edit org, options[:params], options[:format]
+ global_options = options.dup
+ params = options[:params].dup
+ params['billing_email'] = options[:billing_email] if options[:billing_email]
+ params['company'] = options[:company] if options[:company]
+ params['email'] = options[:email] if options[:email]
+ params['location'] = options[:location] if options[:location]
+ params['name'] = options[:name] if options[:name]
+ Util.hash_without!(global_options, params.keys + ['params'])
+ Organization.edit org, params, global_options
end
end # Organizations
end # GithubCLI