mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 23:02:27 +01:00
simplify parseSpecs longname/shortname pattern
This commit is contained in:
@@ -42,6 +42,7 @@ function Command(specs, description, action, extraInfo) //{{{
|
|||||||
function parseSpecs(specs)
|
function parseSpecs(specs)
|
||||||
{
|
{
|
||||||
// Whoever wrote the following should be ashamed. :(
|
// Whoever wrote the following should be ashamed. :(
|
||||||
|
// Good grief! I have no words... -- djk ;-)
|
||||||
// let shortNames = longNames = names = [];
|
// let shortNames = longNames = names = [];
|
||||||
let names = [];
|
let names = [];
|
||||||
let longNames = [];
|
let longNames = [];
|
||||||
@@ -49,7 +50,7 @@ function Command(specs, description, action, extraInfo) //{{{
|
|||||||
|
|
||||||
for (let [,spec] in Iterator(specs))
|
for (let [,spec] in Iterator(specs))
|
||||||
{
|
{
|
||||||
let matches = spec.match(/(\w+|!)\[(\w+)\]/);
|
let matches = spec.match(/(\w+)\[(\w+)\]/);
|
||||||
|
|
||||||
if (matches)
|
if (matches)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user