Skip to content

Commit

Permalink
Properly fix quit command
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben Bridgewater committed Jan 3, 2016
1 parent 18da5e5 commit 2c091a5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
11 changes: 11 additions & 0 deletions commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,17 @@
"keyStop": 0,
"step": 0
},
"quit": {
"arity": 1,
"flags": [
"loading",
"stale",
"readonly"
],
"keyStart": 0,
"keyStop": 0,
"step": 0
},
"randomkey": {
"arity": 1,
"flags": [
Expand Down
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ var commands = require('./commands');
* @var {string[]}
* @public
*/
var commandsList = Object.keys(commands);
commandsList.push('quit');
exports.list = commandsList;
exports.list = Object.keys(commands);

/**
* Check if the command has the flag
Expand Down
1 change: 1 addition & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('redis-commands', function () {
expect(commands.hasFlag('set', 'fast')).to.eql(false);
expect(commands.hasFlag('set', 'readonly')).to.eql(false);
expect(commands.hasFlag('select', 'denyoom')).to.eql(false);
expect(commands.hasFlag('quit', 'denyoom')).to.eql(false);
});
});

Expand Down
15 changes: 15 additions & 0 deletions tools/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ redis.command(function (err, res) {
return prev;
}, {});

// Future proof. Redis might implement this soon
if (!commands.quit) {
commands.quit = {
arity: 1,
flags: [
'loading',
'stale',
'readonly'
],
keyStart: 0,
keyStop: 0,
step: 0
}
}

// Use json-stable-stringify instead fo JSON.stringify
// for easier diffing
var content = stringify(commands, { space: ' ' });
Expand Down

0 comments on commit 2c091a5

Please sign in to comment.