Skip to content

Commit

Permalink
Merge pull request #310 from NearAutomata/master
Browse files Browse the repository at this point in the history
Remove toLowerCase calls which cause trouble with certain commands
  • Loading branch information
milesj committed Aug 15, 2018
2 parents 98d29ed + 333ff8f commit f0eb1e0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/vorpal-commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = function (vorpal) {
var self = this;
if (args.command) {
args.command = args.command.join(' ');
var name = _.find(this.parent.commands, { _name: String(args.command).toLowerCase().trim() });
var name = _.find(this.parent.commands, { _name: String(args.command).trim() });
if (name && !name._hidden) {
if (_.isFunction(name._help)) {
name._help(args.command, function (str) {
Expand Down
4 changes: 2 additions & 2 deletions dist/vorpal.js
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ vorpal._exec = function (item) {
var init = match._init || function (arrgs, cb) {
cb();
};
var delimiter = match._delimiter || String(item.command).toLowerCase() + ':';
var delimiter = match._delimiter || String(item.command) + ':';

item.args = self.util.buildCommandArgs(matchArgs, match, item, self.isCommandArgKeyPairNormalized);

Expand Down Expand Up @@ -1093,7 +1093,7 @@ vorpal._commandHelp = function (command) {
var matches = [];
var singleMatches = [];

command = command ? String(command).trim().toLowerCase() : undefined;
command = command ? String(command).trim() : undefined;
for (var i = 0; i < this.commands.length; ++i) {
var parts = String(this.commands[i]._name).split(' ');
if (parts.length === 1 && parts[0] === command && !this.commands[i]._hidden && !this.commands[i]._catch) {
Expand Down
2 changes: 1 addition & 1 deletion lib/vorpal-commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function (vorpal) {
const self = this;
if (args.command) {
args.command = args.command.join(' ');
var name = _.find(this.parent.commands, {_name: String(args.command).toLowerCase().trim()});
var name = _.find(this.parent.commands, {_name: String(args.command).trim()});
if (name && !name._hidden) {
if (_.isFunction(name._help)) {
name._help(args.command, function (str) {
Expand Down
4 changes: 2 additions & 2 deletions lib/vorpal.js
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ vorpal._exec = function (item) {
var init = match._init || function (arrgs, cb) {
cb();
};
var delimiter = match._delimiter || String(item.command).toLowerCase() + ':';
var delimiter = match._delimiter || String(item.command) + ':';

item.args = self.util.buildCommandArgs(matchArgs, match, item, self.isCommandArgKeyPairNormalized);

Expand Down Expand Up @@ -1088,7 +1088,7 @@ vorpal._commandHelp = function (command) {
var matches = [];
var singleMatches = [];

command = (command) ? String(command).trim().toLowerCase() : undefined;
command = (command) ? String(command).trim() : undefined;
for (var i = 0; i < this.commands.length; ++i) {
var parts = String(this.commands[i]._name).split(' ');
if (parts.length === 1 && parts[0] === command && !this.commands[i]._hidden && !this.commands[i]._catch) {
Expand Down

0 comments on commit f0eb1e0

Please sign in to comment.