aboutsummaryrefslogtreecommitdiff
path: root/src/command
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-08-21 19:31:26 +0200
committerAdrian Kummerlaender2015-08-21 19:31:26 +0200
commit264636ce4c2677ff32bca7dc432b0a086bf5cece (patch)
tree0ab00f7d15c36d6de04561c706d5b46b94796b74 /src/command
parentd56394ad17463e15e93d712e97eccbf3b7846e6a (diff)
downloadMetaTerm-264636ce4c2677ff32bca7dc432b0a086bf5cece.tar
MetaTerm-264636ce4c2677ff32bca7dc432b0a086bf5cece.tar.gz
MetaTerm-264636ce4c2677ff32bca7dc432b0a086bf5cece.tar.bz2
MetaTerm-264636ce4c2677ff32bca7dc432b0a086bf5cece.tar.lz
MetaTerm-264636ce4c2677ff32bca7dc432b0a086bf5cece.tar.xz
MetaTerm-264636ce4c2677ff32bca7dc432b0a086bf5cece.tar.zst
MetaTerm-264636ce4c2677ff32bca7dc432b0a086bf5cece.zip
Implement automatic key suggestion in `set` command
Diffstat (limited to 'src/command')
-rw-r--r--src/command/commands.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/command/commands.js b/src/command/commands.js
index d27fa58..b2216b7 100644
--- a/src/command/commands.js
+++ b/src/command/commands.js
@@ -55,6 +55,24 @@ function ls(output) {
function set(output, args) {
switch ( args.length ) {
+ case 0: {
+ Object.keys(settings).filter(
+ function(element) {
+ return element !== 'objectName'
+ && typeof settings[element] !== 'function';
+ }
+ ).forEach(output.log);
+ break;
+ }
+ case 1: {
+ Object.keys(settings[args[0]]).filter(
+ function(element) {
+ return element !== 'objectName'
+ && typeof settings[args[0]][element] !== 'function';
+ }
+ ).forEach(output.log);
+ break;
+ }
case 2: {
output.log(settings.read(args[0], args[1]));
break;