Parameters in Atom commands

Hi. I wrote simple hack, to add parameters in Atom commands .
For example we have this line in keymap file
'ctrl-a': 'path:some-command-name|some-value'

Then command’s handler will has special property in first argument.

atom.commands.add 'atom-workspace', 'path:some-command-name|*', (event)->
  event.param # "some-value"

How do you like this idea? I believe this will make composite commands more useful
It also implements the possibility that any action can be a command.


I really like this idea. I tried a week or two ago to pass a parameter to a command and found out that you have to make either discrete commands (e.g. fold at indent level 1, 2, etc) or your own UI to gather the input (jump to line, command fuzzy finder). This would make it much simpler to write a command once and customize it later.

Does it handle multiple parameters? If you wanted to put this into a package (or core if the atom team thinks it should live there), you could make a function like atom.commands.dispatchWith that takes a command and parameter(s) and prompts the user for parameters and passes them along to the provided command.