OK, if anyone else is interested, I figured this out. You can define additional "features" in the Ant property "build.options". For example, if you set this in build.properties:
Then you can do this in your code:
and only "foo" will appear.
Unfortunately this is yet another aspect of Sencha Cmd that's poorly documented and difficult to configure.