Class: Fig::Command::Options
- Inherits:
-
Object
- Object
- Fig::Command::Options
- Defined in:
- lib/fig/command/options.rb,
lib/fig/command/options/parser.rb
Overview
Command-line processing.
Defined Under Namespace
Classes: Parser
Instance Attribute Summary collapse
-
#asset_statements ⇒ Object
readonly
Returns the value of attribute asset_statements.
-
#command_extra_argv ⇒ Object
readonly
Returns the value of attribute command_extra_argv.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#descriptor ⇒ Object
readonly
Returns the value of attribute descriptor.
-
#environment_statements ⇒ Object
readonly
Returns the value of attribute environment_statements.
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
-
#figrc ⇒ Object
readonly
Returns the value of attribute figrc.
-
#file_to_find_package_for ⇒ Object
readonly
Returns the value of attribute file_to_find_package_for.
-
#home ⇒ Object
readonly
Returns the value of attribute home.
-
#log_config ⇒ Object
readonly
Returns the value of attribute log_config.
-
#log_level ⇒ Object
readonly
Returns the value of attribute log_level.
-
#log_to_stdout ⇒ Object
readonly
Returns the value of attribute log_to_stdout.
-
#package_definition_file ⇒ Object
readonly
Returns the value of attribute package_definition_file.
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
-
#publish_comment ⇒ Object
readonly
Returns the value of attribute publish_comment.
-
#shell_command ⇒ Object
readonly
Returns the value of attribute shell_command.
-
#suppress_cleanup_of_retrieves ⇒ Object
readonly
Returns the value of attribute suppress_cleanup_of_retrieves.
-
#suppress_includes ⇒ Object
readonly
Returns the value of attribute suppress_includes.
-
#suppress_retrieves ⇒ Object
readonly
Returns the value of attribute suppress_retrieves.
-
#update_lock_response ⇒ Object
readonly
Returns the value of attribute update_lock_response.
-
#variable_to_get ⇒ Object
readonly
Returns the value of attribute variable_to_get.
-
#version_message ⇒ Object
Returns the value of attribute version_message.
-
#version_plain ⇒ Object
Returns the value of attribute version_plain.
Instance Method Summary collapse
- #actions ⇒ Object
- #force? ⇒ Boolean
- #full_help_message ⇒ Object
-
#initialize ⇒ Options
constructor
A new instance of Options.
- #login? ⇒ Boolean
- #no_figrc? ⇒ Boolean
- #no_remote_figrc? ⇒ Boolean
- #options_message ⇒ Object
- #process_command_line(argv) ⇒ Object
- #short_help_message ⇒ Object
- #suppress_vcs_comments_in_published_packages? ⇒ Boolean
- #suppress_warning_include_statement_missing_version? ⇒ Boolean
- #suppress_warning_unused_retrieve? ⇒ Boolean
Constructor Details
Instance Attribute Details
#asset_statements ⇒ Object (readonly)
Returns the value of attribute asset_statements.
50 51 52 |
# File 'lib/fig/command/options.rb', line 50 def asset_statements @asset_statements end |
#command_extra_argv ⇒ Object (readonly)
Returns the value of attribute command_extra_argv.
51 52 53 |
# File 'lib/fig/command/options.rb', line 51 def command_extra_argv @command_extra_argv end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
52 53 54 |
# File 'lib/fig/command/options.rb', line 52 def config @config end |
#descriptor ⇒ Object (readonly)
Returns the value of attribute descriptor.
53 54 55 |
# File 'lib/fig/command/options.rb', line 53 def descriptor @descriptor end |
#environment_statements ⇒ Object (readonly)
Returns the value of attribute environment_statements.
54 55 56 |
# File 'lib/fig/command/options.rb', line 54 def environment_statements @environment_statements end |
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code.
55 56 57 |
# File 'lib/fig/command/options.rb', line 55 def exit_code @exit_code end |
#figrc ⇒ Object (readonly)
Returns the value of attribute figrc.
56 57 58 |
# File 'lib/fig/command/options.rb', line 56 def figrc @figrc end |
#file_to_find_package_for ⇒ Object (readonly)
Returns the value of attribute file_to_find_package_for.
57 58 59 |
# File 'lib/fig/command/options.rb', line 57 def file_to_find_package_for @file_to_find_package_for end |
#home ⇒ Object (readonly)
Returns the value of attribute home.
58 59 60 |
# File 'lib/fig/command/options.rb', line 58 def home @home end |
#log_config ⇒ Object (readonly)
Returns the value of attribute log_config.
59 60 61 |
# File 'lib/fig/command/options.rb', line 59 def log_config @log_config end |
#log_level ⇒ Object (readonly)
Returns the value of attribute log_level.
61 62 63 |
# File 'lib/fig/command/options.rb', line 61 def log_level @log_level end |
#log_to_stdout ⇒ Object (readonly)
Returns the value of attribute log_to_stdout.
60 61 62 |
# File 'lib/fig/command/options.rb', line 60 def log_to_stdout @log_to_stdout end |
#package_definition_file ⇒ Object (readonly)
Returns the value of attribute package_definition_file.
62 63 64 |
# File 'lib/fig/command/options.rb', line 62 def package_definition_file @package_definition_file end |
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
63 64 65 |
# File 'lib/fig/command/options.rb', line 63 def parser @parser end |
#publish_comment ⇒ Object (readonly)
Returns the value of attribute publish_comment.
64 65 66 |
# File 'lib/fig/command/options.rb', line 64 def publish_comment @publish_comment end |
#shell_command ⇒ Object (readonly)
Returns the value of attribute shell_command.
65 66 67 |
# File 'lib/fig/command/options.rb', line 65 def shell_command @shell_command end |
#suppress_cleanup_of_retrieves ⇒ Object (readonly)
Returns the value of attribute suppress_cleanup_of_retrieves.
66 67 68 |
# File 'lib/fig/command/options.rb', line 66 def suppress_cleanup_of_retrieves @suppress_cleanup_of_retrieves end |
#suppress_includes ⇒ Object (readonly)
Returns the value of attribute suppress_includes.
67 68 69 |
# File 'lib/fig/command/options.rb', line 67 def suppress_includes @suppress_includes end |
#suppress_retrieves ⇒ Object (readonly)
Returns the value of attribute suppress_retrieves.
68 69 70 |
# File 'lib/fig/command/options.rb', line 68 def suppress_retrieves @suppress_retrieves end |
#update_lock_response ⇒ Object (readonly)
Returns the value of attribute update_lock_response.
69 70 71 |
# File 'lib/fig/command/options.rb', line 69 def update_lock_response @update_lock_response end |
#variable_to_get ⇒ Object (readonly)
Returns the value of attribute variable_to_get.
70 71 72 |
# File 'lib/fig/command/options.rb', line 70 def variable_to_get @variable_to_get end |
#version_message ⇒ Object
Returns the value of attribute version_message.
71 72 73 |
# File 'lib/fig/command/options.rb', line 71 def @version_message end |
#version_plain ⇒ Object
Returns the value of attribute version_plain.
72 73 74 |
# File 'lib/fig/command/options.rb', line 72 def version_plain @version_plain end |
Instance Method Details
#actions ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/fig/command/options.rb', line 110 def actions() actions = [] # Update has got to come first so that the Repository knows what's going # on. if @update_action actions << @update_action end if @base_action actions << @base_action end return actions end |
#force? ⇒ Boolean
125 126 127 |
# File 'lib/fig/command/options.rb', line 125 def force?() return @force end |
#full_help_message ⇒ Object
137 138 139 |
# File 'lib/fig/command/options.rb', line 137 def () return @parser.full_help + EXTRA_OPTIONS_DESCRIPTION end |
#login? ⇒ Boolean
145 146 147 |
# File 'lib/fig/command/options.rb', line 145 def login?() return @login end |
#no_figrc? ⇒ Boolean
149 150 151 |
# File 'lib/fig/command/options.rb', line 149 def no_figrc?() return @no_figrc end |
#no_remote_figrc? ⇒ Boolean
153 154 155 |
# File 'lib/fig/command/options.rb', line 153 def no_remote_figrc?() return @no_remote_figrc end |
#options_message ⇒ Object
141 142 143 |
# File 'lib/fig/command/options.rb', line 141 def () return @parser. + EXTRA_OPTIONS_DESCRIPTION end |
#process_command_line(argv) ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/fig/command/options.rb', line 79 def process_command_line(argv) argv = argv.clone strip_shell_command(argv) set_up_parser() @parser.parse!(argv) if not exit_code.nil? return end if argv.size > 1 $stderr.puts %q<Extra arguments. Should only have a package/version after all other options. Had "> + argv.join(%q<", ">) + %q<" left over.> @exit_code = 1 return end derive_primary_descriptor(argv.first) if not @base_action and @descriptor set_base_action(Fig::Command::Action::RunCommandStatement) end set_up_sub_actions() validate actions().each {|action| action.configure(self)} return end |
#short_help_message ⇒ Object
133 134 135 |
# File 'lib/fig/command/options.rb', line 133 def () return @parser.short_help end |
#suppress_vcs_comments_in_published_packages? ⇒ Boolean
129 130 131 |
# File 'lib/fig/command/options.rb', line 129 def suppress_vcs_comments_in_published_packages?() return @suppress_vcs_comments_in_published_packages end |
#suppress_warning_include_statement_missing_version? ⇒ Boolean
157 158 159 |
# File 'lib/fig/command/options.rb', line 157 def suppress_warning_include_statement_missing_version?() return @suppress_warning_include_statement_missing_version end |
#suppress_warning_unused_retrieve? ⇒ Boolean
161 162 163 |
# File 'lib/fig/command/options.rb', line 161 def suppress_warning_unused_retrieve?() return @suppress_warning_unused_retrieve end |