Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64237

CLI shows provided values as "default"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: cli, core
    • Labels:
      None
    • Similar Issues:

      Description

      The Jenkins CLI prints a help text when a command is not used correctly. This help text includes information about the default values of parameters that can be specified.

      If the invocation that triggers this help text provides values for parameters, those are shown instead of the actual defaults.

      Output below based on core PR 4274 which adds the "reason" parameter (and made me wonder what sort of default value "bar" is!?), but affects other commands:

      $ java -jar jenkins-cli.jar -webSocket -auth admin:admin -s http://localhost:8080 quiet-down -reason 'bar' -timeout 42 foo
      
      ERROR: No argument is allowed: foo
      java -jar jenkins-cli.jar quiet-down [-block] [-reason VAL] [-timeout N]
      Quiet down Jenkins, in preparation for a restart. Don’t start any builds.
       -block      : Block until the system really quiets down and no builds are
                     running (default: false)
       -reason VAL : Reason for quiet down that will be visible to users (default:
                     bar)
       -timeout N  : If non-zero, only block up to the specified number of
                     milliseconds (default: 42)
       

      Here's a fun one:

      $ java -jar jenkins-cli.jar -webSocket -auth admin:admin -s http://localhost:8080 list-jobs foo bar
      
      ERROR: Too many arguments: bar
      java -jar jenkins-cli.jar list-jobs [NAME]
      Lists all jobs in a specific view or item group.
       NAME : Name of the view (default: foo) 

        Attachments

          Activity

          danielbeck Daniel Beck created issue -
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          The bug was introduced in the original PR with defaults support: https://github.com/kohsuke/args4j/pull/102/files#diff-ae8264f9f90560e7c61c15563435d12ec2fff8b905db41cf85d328e6a9a6e237R375-R379 . getter#getValue() indeed returns the field value

          Show
          oleg_nenashev Oleg Nenashev added a comment - The bug was introduced in the original PR with defaults support: https://github.com/kohsuke/args4j/pull/102/files#diff-ae8264f9f90560e7c61c15563435d12ec2fff8b905db41cf85d328e6a9a6e237R375-R379  . getter#getValue() indeed returns the field value

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            danielbeck Daniel Beck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: