GCLI should support grouped parameters

RESOLVED FIXED

Status

()

Firefox
Developer Tools
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: jwalker, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [estimate:best=2d,likely=3d,worst=10d])

GCLI should allow parameters to be grouped together so the UI can present them in a more logically appealing way.

The metadata should be enhanced to take account of this type of declaration by allowing the params section to contain named groups of parameters in addition to plain parameters.

var ls = {
  name: 'ls',
  description: 'A recognizable example taken from Unix'
  params: [
    {
      name: 'files',
      type: { name: 'array', subtype: 'file' },
      description: 'A list of the files to display, leave empty for all files',
      defaultValue: null
    },
    {
      group: 'Display Options',
      params: [
        {
          name: 'long',
          type: 'boolean',
          description: 'Do you want a long listing of the files'
        },
        {
          name: 'extended-attributes',
          type: 'boolean',
          description: 'Include information on extended attributes'
        }
      ]
    },
    {
      group: 'File Options',
      params: [
        {
          name: 'sort',
          type: { name: 'selection', data: [ 'name', 'size', 'ctime' ] }
          description: 'How should the files be sorted'
        },
        {
          name: 'recursive',
          type: 'boolean',
          description: 'Should files in nested directories be included'
        }
      ]
    }
    exec: function(env, args, request) { ... }
};

All grouped parameters must have defaults so they can be ignored, and will not be accessible using positional arguments, only via named arguments.
Whiteboard: [estimate:best=2d,likely=3d,worst=10d]
Blocks: 642229
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
No longer blocks: 642229
You need to log in before you can comment on or make changes to this bug.