Last Comment Bug 642189 - GCLI should support grouped parameters
: GCLI should support grouped parameters
Status: RESOLVED FIXED
[estimate:best=2d,likely=3d,worst=10d]
:
Product: Firefox
Classification: Client Software
Component: Developer Tools (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: J. Ryan Stinnett [:jryans] (use ni?)
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-16 10:58 PDT by Joe Walker [:jwalker] (needinfo me or ping on irc)
Modified: 2011-05-21 01:32 PDT (History)
0 users
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Joe Walker [:jwalker] (needinfo me or ping on irc) 2011-03-16 10:58:33 PDT
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.

Note You need to log in before you can comment on or make changes to this bug.