function synopsisFromOpt(o) {
    assert.object(o, 'o');

    if (o.hasOwnProperty('group')) {
        return null;
    }
    var names = o.names || [o.name];
    // `type` here could be undefined if, for example, the command has a
    // dashdash option spec with a bogus 'type'.
    var type = getOptionType(o.type);
    var helpArg = o.helpArg || (type && type.helpArg) || 'ARG';
    var parts = [];
    names.forEach(function (name) {
        var part = (name.length === 1 ? '-' : '--') + name;
        if (type && type.takesArg) {
            part += (name.length === 1 ? ' ' + helpArg : '=' + helpArg);
        }
        parts.push(part);
    });
    return ('[ ' + parts.join(' | ') + ' ]');
}
Return a synopsis string for the given option spec.

Examples:
     > synopsisFromOpt({names: ['help', 'h'], type: 'bool'});
     '[ --help | -h ]'
     > synopsisFromOpt({name: 'file', type: 'string', helpArg: 'FILE'});
     '[ --file=FILE ]'