Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
2c0cc3e2
Commit
2c0cc3e2
authored
Aug 13, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Command] Report unrecognized arguments in help and minor improvements.
parent
9cbb2dfd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
13 deletions
+17
-13
command.rb
lib/cocoapods/command.rb
+12
-7
install.rb
lib/cocoapods/command/install.rb
+1
-1
outdated.rb
lib/cocoapods/command/outdated.rb
+2
-2
update.rb
lib/cocoapods/command/update.rb
+2
-3
No files found.
lib/cocoapods/command.rb
View file @
2c0cc3e2
...
...
@@ -16,12 +16,12 @@ module Pod
autoload
:Update
,
'cocoapods/command/update'
class
Help
<
Informative
def
initialize
(
command_class
,
argv
)
@command_class
,
@argv
=
command_class
,
argv
def
initialize
(
command_class
,
argv
,
unrecognized_command
=
nil
)
@command_class
,
@argv
,
@unrecognized_command
=
command_class
,
argv
,
unrecognized_command
end
def
message
[
message
=
[
''
,
@command_class
.
banner
.
gsub
(
/\$ pod (.*)/
,
'$ pod \1'
.
green
),
''
,
...
...
@@ -30,6 +30,9 @@ module Pod
options
,
"
\n
"
,
].
join
(
"
\n
"
)
message
<<
"[!] Unrecognized command: `
#{
@unrecognized_command
}
'
\n
"
.
red
if
@unrecognized_command
message
<<
"[!] Unrecognized argument
#{
@argv
.
count
>
1
?
's'
:
''
}
: `
#{
@argv
.
join
(
' - '
)
}
'
\n
"
.
red
unless
@argv
.
empty?
message
end
private
...
...
@@ -50,7 +53,7 @@ module Pod
end
def
self
.
banner
commands
=
[
'install'
,
'list'
,
'push'
,
'repo'
,
'search'
,
'setup'
,
'spec'
].
sort
commands
=
[
'install'
,
'
update'
,
'outdated'
,
'
list'
,
'push'
,
'repo'
,
'search'
,
'setup'
,
'spec'
].
sort
banner
=
"
\n
To see help for the available commands run:
\n\n
"
commands
.
each
{
|
cmd
|
banner
<<
" * $ pod
#{
cmd
.
green
}
--help
\n
"
}
banner
...
...
@@ -100,7 +103,7 @@ module Pod
String
.
send
(
:define_method
,
:colorize
)
{
|
string
,
_
|
string
}
if
argv
.
option
(
'--no-color'
)
command_class
=
case
argv
.
shift_argument
command_class
=
case
command_argument
=
argv
.
shift_argument
when
'install'
then
Install
when
'list'
then
List
when
'outdated'
then
Outdated
...
...
@@ -112,8 +115,10 @@ module Pod
when
'update'
then
Update
end
if
show_help
||
command_class
.
nil?
raise
Help
.
new
(
command_class
||
self
,
argv
)
if
show_help
raise
Help
.
new
(
command_class
,
argv
)
elsif
command_class
.
nil?
raise
Help
.
new
(
self
,
argv
,
command_argument
)
else
command_class
.
new
(
argv
)
end
...
...
lib/cocoapods/command/install.rb
View file @
2c0cc3e2
...
...
@@ -6,7 +6,7 @@ module Pod
$ pod install
Downloads all dependencies
updat
ed in `Podfile' and creates an Xcode
Downloads all dependencies
defin
ed in `Podfile' and creates an Xcode
Pods library project in `./Pods'.
The Xcode project file should be specified in your `Podfile` like this:
...
...
lib/cocoapods/command/outdated.rb
View file @
2c0cc3e2
...
...
@@ -2,11 +2,11 @@ module Pod
class
Command
class
Outdated
<
Command
def
self
.
banner
%{
Updates dependencies of a project
:
%{
Show outdated pods
:
$ pod outdated
Show
all of
the outdated pods in the current Podfile.lock. }
Show
s
the outdated pods in the current Podfile.lock. }
end
def
self
.
options
...
...
lib/cocoapods/command/update.rb
View file @
2c0cc3e2
...
...
@@ -2,12 +2,11 @@ module Pod
class
Command
class
Update
<
Command
def
self
.
banner
%{Updat
es
dependencies of a project:
%{Updat
ing
dependencies of a project:
$ pod update
Updates all dependencies installed by `pod install`. It doesn't
install new dependencies. }
Updates all dependencies.}
end
def
self
.
options
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment