File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,24 @@ def usage_presentation
2222 #
2323 # Returns the string representation of the options
2424 def options_presentation
25+ return nil unless command_options_presentation || parent_command_options_presentation
26+ [ command_options_presentation , parent_command_options_presentation ] . compact . join ( "\n " )
27+ end
28+
29+ def command_options_presentation
2530 return nil unless command . options . size > 0
2631 command . options . map ( &:to_s ) . join ( "\n " )
2732 end
2833
34+ # Public: Builds a string representation of the options for parent
35+ # commands
36+ #
37+ # Returns the string representation of the options for parent commands
38+ def parent_command_options_presentation
39+ return nil unless command . parent
40+ Presenter . new ( command . parent ) . options_presentation
41+ end
42+
2943 # Public: Builds a string representation of the subcommands
3044 #
3145 # Returns the string representation of the subcommands
You can’t perform that action at this time.
0 commit comments