From 5930a6e3510f2bd052771601581aa410728d68e3 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 30 May 2015 06:16:24 +0100 Subject: Use the term "options" instead of "flags" for command options. "Flags" implies binary toggles. The term "options" seems more consistent with what's actually going on here. --- background_scripts/commands.coffee | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index 1714ae56..fa5354df 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -24,13 +24,13 @@ Commands = noRepeat: options.noRepeat repeatLimit: options.repeatLimit - mapKeyToCommand: ({ key, command, extras }) -> + mapKeyToCommand: ({ key, command, options }) -> unless @availableCommands[command] console.log command, "doesn't exist!" return - extras ?= [] - @keyToCommandRegistry[key] = extend { command, extras }, @availableCommands[command] + options ?= [] + @keyToCommandRegistry[key] = extend { command, options }, @availableCommands[command] # Lower-case the appropriate portions of named keys. # @@ -51,11 +51,11 @@ Commands = tokens = line.replace(/\s+$/, "").split /\s+/ switch tokens[0] when "map" - [ _, key, command, extras... ] = tokens + [ _, key, command, options... ] = tokens if command? and @availableCommands[command] key = @normalizeKey key console.log "Mapping", key, "to", command - @mapKeyToCommand { key, command, extras } + @mapKeyToCommand { key, command, options } when "unmap" if tokens.length == 2 -- cgit v1.2.3