Closed Bug 642189 Opened 13 years ago Closed 13 years ago

GCLI should support grouped parameters

Categories

(DevTools :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jwalker, Unassigned)

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]
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
No longer blocks: GCLI-EXPERIMENT
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.