Commit 54a496dc authored by Olivier Halligon's avatar Olivier Halligon

Migrating to new CLAide::Command#arguments syntax (see CocoaPods/CLAide#26)

parent 686af4af
......@@ -2,7 +2,9 @@ module Pod
class Command
class Help < Command
self.summary = 'Show help for the given command.'
self.arguments = '[COMMAND]'
self.arguments = [
['COMMAND', :optional]
]
def initialize(argv)
@help_command = Pod::Command.parse(argv)
......
......@@ -17,7 +17,9 @@ module Pod
(test targets) files which should be stored in the
`~/.cocoapods/templates` folder.
DESC
self.arguments = '[XCODEPROJ]'
self.arguments = [
['XCODEPROJ', :optional]
]
def initialize(argv)
@podfile_path = Pathname.pwd + "Podfile"
......
......@@ -15,7 +15,9 @@ module Pod
self.summary = 'Converts a podspec to JSON.'
self.description = 'Converts a podspec to JSON and prints it to STDOUT.'
self.arguments = 'PATH'
self.arguments = [
['PATH', :required]
]
def initialize(argv)
@path = argv.shift_argument
......@@ -40,7 +42,9 @@ module Pod
self.summary = 'Converts a Podfile to YAML.'
self.description = 'Converts a Podfile to YAML and prints it to STDOUT.'
self.arguments = 'PATH'
self.arguments = [
['PATH', :required]
]
def initialize(argv)
@path = argv.shift_argument
......
......@@ -14,7 +14,10 @@ module Pod
If a `TEMPLATE_URL`, pointing to a git repo containing a compatible template, is specified, it will be used in place of the default one.
DESC
self.arguments = 'NAME [TEMPLATE_URL]'
self.arguments = [
['NAME', :required],
['TEMPLATE_URL', :optional]
]
def initialize(argv)
@name = argv.shift_argument
......
......@@ -85,7 +85,9 @@ module Pod
be used to install changes to the Podfile.
DESC
self.arguments = '[POD_NAMES...]'
self.arguments = [
['POD_NAMES...', :optional]
]
def initialize(argv)
@pods = argv.arguments! unless argv.arguments.empty?
......
......@@ -13,7 +13,10 @@ module Pod
directory, and finally it pushes REPO to its remote.
DESC
self.arguments = 'REPO [NAME.podspec]'
self.arguments = [
['REPO', :required],
['NAME.podspec', :optional]
]
def self.options
[ ["--allow-warnings", "Allows pushing even if there are warnings"],
......
......@@ -17,7 +17,11 @@ module Pod
remote can later be referred to by `NAME`.
DESC
self.arguments = 'NAME URL [BRANCH]'
self.arguments = [
['NAME', :required],
['URL', :required],
['BRANCH', :optional]
]
def self.options
[
......@@ -63,7 +67,9 @@ module Pod
this will update all spec-repos in `~/.cocoapods/repos`.
DESC
self.arguments = '[NAME]'
self.arguments = [
['NAME', :optional]
]
def initialize(argv)
@name = argv.shift_argument
......@@ -86,7 +92,9 @@ module Pod
will lint all the spec-repos known to CocoaPods.
DESC
self.arguments = '[ NAME | DIRECTORY ]'
self.arguments = [
['NAME | DIRECTORY', :optional]
]
def self.options
[["--only-errors", "Lint presents only the errors"]].concat(super)
......@@ -152,7 +160,9 @@ module Pod
Deletes the remote named `NAME` from the local spec-repos directory at `~/.cocoapods/repos/.`
DESC
self.arguments = 'NAME'
self.arguments = [
['NAME', :required]
]
def initialize(argv)
@name = argv.shift_argument
......
......@@ -9,7 +9,9 @@ module Pod
description of the pods.
DESC
self.arguments = 'QUERY'
self.arguments = [
['QUERY', :required]
]
def self.options
[
......
......@@ -18,7 +18,9 @@ module Pod
If a GitHub url is passed the spec is prepopulated.
DESC
self.arguments = '[ NAME | https://github.com/USER/REPO ]'
self.arguments = [
['NAME | https://github.com/USER/REPO', :optional]
]
def initialize(argv)
@name_or_url, @url = argv.shift_argument, argv.shift_argument
......@@ -56,7 +58,9 @@ module Pod
the argument is omitted, it defaults to the current working dir.
DESC
self.arguments = '[ NAME.podspec | DIRECTORY | http://PATH/NAME.podspec, ... ]'
self.arguments = [
['NAME.podspec | DIRECTORY | http://PATH/NAME.podspec, ...', :optional]
]
def self.options
[ ["--quick", "Lint skips checks that would require to download and build the spec"],
......@@ -148,7 +152,9 @@ module Pod
Prints the path of 'NAME.podspec'
DESC
self.arguments = '[ NAME ]'
self.arguments = [
['NAME', :optional]
]
def self.options
[["--show-all", "Print all versions of the given podspec"]].concat(super)
......@@ -180,7 +186,9 @@ module Pod
Prints 'NAME.podspec' to standard output.
DESC
self.arguments = '[ NAME ]'
self.arguments = [
['NAME', :optional]
]
def self.options
[["--show-all", "Pick from all versions of the given podspec"]].concat(super)
......@@ -220,7 +228,9 @@ module Pod
Opens 'NAME.podspec' to be edited.
DESC
self.arguments = '[ NAME ]'
self.arguments = [
['NAME', :optional]
]
def self.options
[["--show-all", "Pick which spec to edit from all available versions of the given podspec"]].concat(super)
......
......@@ -15,7 +15,7 @@ module Pod
end
it "shows the right usage" do
Pod::Command::Help.arguments.should.equal '[COMMAND]'
Pod::Command::Help.arguments.should.equal [['COMMAND', :optional]]
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment