Pass values from menu to command


#1

Is it possible to pass values from a menu item to the command it’s invoking?
E.g.:

'menu': [
  {
    'label': 'Packages'
    'submenu': [
      'label': 'Foo'
      'submenu': [
        { 'label': 'Bar', 'command': 'my-package:foo' }
        { 'label': 'Qux', 'command': 'my-package:foo' }
      ]
    ]
  }
]

When the user selects Bar, I’d like to pass “Bar” to the “foo” method. I’ve tried

my-package:foo:Bar
my-package:foo Bar

But alas, it doesn’t work.