Added help command. Usage `pod help [COMMAND]` #957

Merged
merged 4 commits into from Apr 10, 2013

Conversation

Projects
None yet
3 participants
@supermarin
Member

supermarin commented Apr 10, 2013

The old behavior is kept. You can use:

$ pod push --help
$ pod help push
$ pod help
lib/cocoapods/command/help.rb
+module Pod
+ class Command
+ class Help < Command
+ self.summary = 'Show help for the given command'

This comment has been minimized.

@fabiopelosin

fabiopelosin Apr 10, 2013

Member

Missing proper punctuation to terminate the sentence 😄 (this might be a clue about who implemented the annoying warning when you lint a spec).

@fabiopelosin

fabiopelosin Apr 10, 2013

Member

Missing proper punctuation to terminate the sentence 😄 (this might be a clue about who implemented the annoying warning when you lint a spec).

@@ -16,6 +16,7 @@ class Command < CLAide::Command
require 'cocoapods/command/search'
require 'cocoapods/command/setup'
require 'cocoapods/command/spec'
+ require 'cocoapods/command/help'

This comment has been minimized.

@fabiopelosin

fabiopelosin Apr 10, 2013

Member

I think that this functionality should go in CLAide directly. Not sure though, and we could move it later on.

@fabiopelosin

fabiopelosin Apr 10, 2013

Member

I think that this functionality should go in CLAide directly. Not sure though, and we could move it later on.

This comment has been minimized.

@alloy

alloy Apr 10, 2013

Member

It might be worth it to create a ticket as reminder, but I’m still on the fence.

@alloy

alloy Apr 10, 2013

Member

It might be worth it to create a ticket as reminder, but I’m still on the fence.

@@ -1 +1 @@
-Subproject commit e54bfaa54110629cbb7495a5cdbb237b1fffe8f8
+Subproject commit ee564d9da8878957e7b77cac987d9601eb04eca5

This comment has been minimized.

@fabiopelosin

fabiopelosin Apr 10, 2013

Member

As you have update the specs repo a test is failing because new Pods/versions which affect it might have been introduced.

@fabiopelosin

fabiopelosin Apr 10, 2013

Member

As you have update the specs repo a test is failing because new Pods/versions which affect it might have been introduced.

This comment has been minimized.

@supermarin

supermarin Apr 10, 2013

Member

:( wasn't me, I swear 😄

Will try to rebase on origin/master before submitting again

@supermarin

supermarin Apr 10, 2013

Member

:( wasn't me, I swear 😄

Will try to rebase on origin/master before submitting again

This comment has been minimized.

@fabiopelosin

fabiopelosin Apr 10, 2013

Member

You can keep the update and just fix the spec as well.

@fabiopelosin

fabiopelosin Apr 10, 2013

Member

You can keep the update and just fix the spec as well.

lib/cocoapods/command/help.rb
+
+ def self.parse(argv)
+ command_needs_help = [argv.shift_argument, '--help']
+ argv.empty? ? super : Pod::Command.parse(command_needs_help)

This comment has been minimized.

@fabiopelosin

fabiopelosin Apr 10, 2013

Member

I would do something like:

if argv.empty?
  super
else
  @help_command = Pod::Command.parse(argv)
end
@fabiopelosin

fabiopelosin Apr 10, 2013

Member

I would do something like:

if argv.empty?
  super
else
  @help_command = Pod::Command.parse(argv)
end
lib/cocoapods/command/help.rb
+ end
+
+ def run
+ help!

This comment has been minimized.

@fabiopelosin

fabiopelosin Apr 10, 2013

Member
@help_command.help!

Currently it always shows the banner of the help subcommand.

@fabiopelosin

fabiopelosin Apr 10, 2013

Member
@help_command.help!

Currently it always shows the banner of the help subcommand.

This comment has been minimized.

@supermarin

supermarin Apr 10, 2013

Member

In fact, the self.parse returns a completely different object, so it behaves as you expect.

A different problem is that my implementation is probably a bit too implicit, and your comment is the right sign :)

@supermarin

supermarin Apr 10, 2013

Member

In fact, the self.parse returns a completely different object, so it behaves as you expect.

A different problem is that my implementation is probably a bit too implicit, and your comment is the right sign :)

@fabiopelosin

This comment has been minimized.

Show comment
Hide comment
Member

fabiopelosin commented Apr 10, 2013

👍

@supermarin supermarin referenced this pull request Apr 10, 2013

Closed

Add pod help subcommand #949

supermarin pushed a commit that referenced this pull request Apr 10, 2013

Marin Usalj
Merge pull request #957 from CocoaPods/help
Added help command. Usage `pod help [COMMAND]`

@supermarin supermarin merged commit 2a6f800 into master Apr 10, 2013

@fabiopelosin fabiopelosin deleted the help branch Apr 10, 2013

jzapater pushed a commit to jzapater/CocoaPods that referenced this pull request Sep 17, 2013

Merge pull request #957 from jorgenpt/master
Add ObjectiveMetrics podspec.
@alloy

This comment has been minimized.

Show comment
Hide comment
@alloy

alloy May 16, 2014

Member

@supermarin Do you really use this? I really want to get rid of it, there should be only one way to do this imo.

/cc @irrationalfab

Member

alloy commented on a725d61 May 16, 2014

@supermarin Do you really use this? I really want to get rid of it, there should be only one way to do this imo.

/cc @irrationalfab

This comment has been minimized.

Show comment
Hide comment
@supermarin

supermarin May 17, 2014

Member

@alloy I don't, but the rationale was people complaining it doesn't keep conventions of other CLI tools, e.g.
git help init
bundle help exec

Member

supermarin replied May 17, 2014

@alloy I don't, but the rationale was people complaining it doesn't keep conventions of other CLI tools, e.g.
git help init
bundle help exec

This comment has been minimized.

Show comment
Hide comment
@alloy

alloy May 17, 2014

Member

@supermarin Understood, but I think it’s better to have one way to do it. Also, if you want help with this pattern, you have to move the cursor back to almost the begin of the line, whereas --help can be tacked on, which seems simpler to me, no?

Member

alloy replied May 17, 2014

@supermarin Understood, but I think it’s better to have one way to do it. Also, if you want help with this pattern, you have to move the cursor back to almost the begin of the line, whereas --help can be tacked on, which seems simpler to me, no?

This comment has been minimized.

Show comment
Hide comment
@supermarin

supermarin May 17, 2014

Member

@alloy I believe people just type it vs adding help in the middle when a command fails.
Personally I'm a --help user, so feel free to nuke it if it'll simplify things.

Member

supermarin replied May 17, 2014

@alloy I believe people just type it vs adding help in the middle when a command fails.
Personally I'm a --help user, so feel free to nuke it if it'll simplify things.

This comment has been minimized.

Show comment
Hide comment
@fabiopelosin

fabiopelosin May 19, 2014

Member

👍 For just one way to do things.

Member

fabiopelosin replied May 19, 2014

👍 For just one way to do things.

This comment has been minimized.

Show comment
Hide comment
@alloy

alloy May 20, 2014

Member

Filed #2156.

Member

alloy replied May 20, 2014

Filed #2156.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment