Uploaded image for project: 'MCollective'
  1. MCollective
  2. MCO-520

applications options can support :default, docs don't demonstrate it

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Do
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: DOCS
    • Labels:
      None

      Description

      https://docs.puppetlabs.com/mcollective/reference/plugins/application.html#argument-data-types talks about how to specify options, doesn't explain :default is a supported key https://github.com/puppetlabs/marionette-collective/blob/master/spec/unit/application_spec.rb#L242

      application_spec.rb

      ...
            it "should support default values" do
              Application.any_instance.stubs("main").returns(true)
       
              Application.option :foo,
                                 :description => "meh",
                                 :required => true,
                                 :default => "meh",
                                 :arguments => "--foo [FOO]"
       
              a = Application.new
              a.run
              a.configuration.should == {:foo => "meh"}
            end
      ...
      

      We should cover that too.

        Attachments

          Activity

            People

            • Assignee:
              richard Richard Clamp
              Reporter:
              richard Richard Clamp
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support