Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-32986

fix option handling in butler CLI presets files

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Story Points:
      3
    • Sprint:
      DB_S22_12
    • Team:
      Data Access and Database
    • Urgent?:
      No

      Description

      In preset files, the options have to be named according to the command function argument they were overriding. This is confusing to the user for 2 reasons:
      1. the option name uses underscores instead of dashes
      2. if the command argument name is changed in the option declaration (example below) then the command argument name that has to be used is totally opaque to the user.

      Example; notice that --my-option is passed to the function as this_argument, because of how the click.option is defined.

      @click.option("--my-option", "this_argument")
      def my_cmd(this_argument):
          ...
      

      The fix is to use the option names in the yaml file (with leading dashes removed), and lookup the the argument name from the option name when applying the yaml file to the command defaults.

        Attachments

          Activity

          Hide
          npease Nate Pease [X] (Inactive) added a comment -

          self-review, Tim signed off on the PR.

          Show
          npease Nate Pease [X] (Inactive) added a comment - self-review, Tim signed off on the PR.

            People

            Assignee:
            npease Nate Pease [X] (Inactive)
            Reporter:
            npease Nate Pease [X] (Inactive)
            Reviewers:
            Nate Pease [X] (Inactive)
            Watchers:
            Nate Pease [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.