Skip to content

api:core:incoming-phone-numbers:update help message displays incorrect information #255

@settermjd

Description

@settermjd

Issue Summary

If you view the help message for the api:core:incoming-phone-numbers:update command, you see the following terminal output:

--voice-method=(head|get|post|patch|put|delete)            The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`.

There are three issues here:

  1. The capitalization of the HTTP methods in the text description on the right is what the method accepts. The lowercase versions of the HTTP methods in the pseudo-call to the command, on the left, are not. It seems entirely possible to suspect that a user might only look at the pseudo example call and attempt to pass a lowercase HTTP method. If they do that they'll see the following error message printed to the console:
 » Flag value validation errors:
 »   voice-method: "post" is not one of "HEAD,GET,POST,PATCH,PUT,DELETE"
 » Cannot execute command
  1. The pseudo example call on the left lists additional HTTP methods which the option does not accept (head, patch, put, and delete).
  2. The validation error also contains more HTTP methods than the option accepts.

Steps to Reproduce

  1. Call the api:core:incoming-phone-numbers:update command and pass the --voice-fallback-method option with a lowercase HTTP method as the option's value, as in the example below.

Code Snippet

twilio api:core:incoming-phone-numbers:update \
  --sid PNb1111111111111111 \
  --voice-url "..." \
  --voice-method=post

Exception/Log

# paste exception/log here

Technical details:

  • twilio-cli version: twilio-cli/2.24.0 darwin-x64 node-v14.15.4
  • node version: v14.15.4
  • Command output with debug logging enabled (adding -l debug to the end of the command):
[DEBUG] Config File: /Users/username/.twilio-cli/config.json
[DEBUG] Using profile: username
[DEBUG] Found command "api:core:incoming-phone-numbers:update" plugin: twilio-cli
[DEBUG] Found keytar version in "@twilio/cli-core" dependencies: ^7.6.0
[DEBUG] Schema for "sid": {"maxLength":34,"minLength":34,"pattern":"^PN[0-9a-fA-F]{32}$","type":"string"}
[DEBUG] Schema for "voice-url": {"description":"The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set.","format":"uri","type":"string"}
[DEBUG] Schema for "voice-method": {"description":"The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`.","enum":["HEAD","GET","POST","PATCH","PUT","DELETE"],"type":"string"}
[DEBUG] Provided flags: {"sid":"...","voice-url":"...","voice-method":"post","cli-log-level":"debug","properties":"sid,phoneNumber,friendlyName","skip-parameter-validation":false,"cli-output-format":"columns"}
 » Flag value validation errors:
 »   voice-method: "post" is not one of "HEAD,GET,POST,PATCH,PUT,DELETE"
 » Cannot execute command
[DEBUG] TwilioCliError: Cannot execute command
    at ApiCommandRunner.validateFlags (/usr/local/Cellar/twilio/2.24.0/libexec/src/services/twilio-api/api-command-runner.js:61:13)
    at ApiCommandRunner.run (/usr/local/Cellar/twilio/2.24.0/libexec/src/services/twilio-api/api-command-runner.js:24:10)
    at NewCommandClass.run (/usr/local/Cellar/twilio/2.24.0/libexec/src/base-commands/twilio-api-command.js:39:35)
    at async NewCommandClass._run (/usr/local/Cellar/twilio/2.24.0/libexec/node_modules/@oclif/command/lib/command.js:43:20)
    at async Config.runCommand (/usr/local/Cellar/twilio/2.24.0/libexec/node_modules/@oclif/config/lib/config.js:173:24)
    at async Main.run (/usr/local/Cellar/twilio/2.24.0/libexec/node_modules/@oclif/command/lib/main.js:27:9)
    at async Main._run (/usr/local/Cellar/twilio/2.24.0/libexec/node_modules/@oclif/command/lib/command.js:43:20)

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumImportant but not urgent; Workaround availablestatus: help wantedrequesting help from the communitytriage queueIssue is in our internal backlog. It's either a bug or a feature enhancement.type: bugbug in the library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions