minor tweaks
This commit is contained in:
parent
f256175f71
commit
b44e8c83b6
2 changed files with 4 additions and 46 deletions
|
|
@ -37,57 +37,18 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Something of a hack to allow the set command to give a clearer definition
|
|
||||||
* of the type to the command line.
|
|
||||||
*/
|
|
||||||
var valueDeferredType = {
|
|
||||||
name: "deferred",
|
|
||||||
undeferType: function(typeSpec, env) {
|
|
||||||
var assignments = typeSpec.assignments;
|
|
||||||
var replacement = 'text';
|
|
||||||
|
|
||||||
if (assignments) {
|
|
||||||
// Find the assignment for 'setting' so we can get it's value
|
|
||||||
var settingAssignment = null;
|
|
||||||
assignments.forEach(function(assignment) {
|
|
||||||
if (assignment.param.name === 'setting') {
|
|
||||||
settingAssignment = assignment;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (settingAssignment) {
|
|
||||||
var settingName = settingAssignment.value;
|
|
||||||
if (settingName && settingName !== '') {
|
|
||||||
var settingExt = settings[settingName];
|
|
||||||
if (settingExt) {
|
|
||||||
replacement = settingExt.type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return replacement;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var setCommandSpec = {
|
var setCommandSpec = {
|
||||||
name: "set",
|
name: "set",
|
||||||
params: [
|
params: [
|
||||||
{
|
{
|
||||||
name: "setting",
|
name: "setting",
|
||||||
type: {
|
type: "setting",
|
||||||
name: "selection",
|
|
||||||
getOptions: function(env) {
|
|
||||||
return env.settings.getSettingNames();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
description: "The name of the setting to display or alter",
|
description: "The name of the setting to display or alter",
|
||||||
defaultValue: null
|
defaultValue: null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "value",
|
name: "value",
|
||||||
type: valueDeferredType,
|
type: "settingValue",
|
||||||
description: "The new value for the chosen setting",
|
description: "The new value for the chosen setting",
|
||||||
defaultValue: null
|
defaultValue: null
|
||||||
}
|
}
|
||||||
|
|
@ -139,10 +100,7 @@ var unsetCommandSpec = {
|
||||||
params: [
|
params: [
|
||||||
{
|
{
|
||||||
name: "setting",
|
name: "setting",
|
||||||
type: {
|
type: "setting",
|
||||||
name: "selection",
|
|
||||||
pointer: "settings:index#getSettings"
|
|
||||||
},
|
|
||||||
description: "The name of the setting to return to defaults"
|
description: "The name of the setting to return to defaults"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var lang = require("pilot/lang").lang;
|
var lang = require('pilot/lang').lang;
|
||||||
|
|
||||||
var EventEmitter = {};
|
var EventEmitter = {};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue