#import <appkit/Listener.h>	// NXSetServicesMenuItemEnabled
#import "Filter.h"

@implementation Hide: Object
- (void) filter: (Filter *) f flag: (char) ch
{
	NXPrintf(f->err, "usage: %s [menu...]\n", f->progname),
	NXFlush(f->err);
	exit(1);
}

- (int) filter: (Filter *) f arg: (const char *) menu
{
	if (menu)
	if (NXSetServicesMenuItemEnabled(menu, NO))
		[self error: "could not hide \"%s\"", menu];
	return 0;
}
@end

int main (int argc, char * argv [])
{
	return [[[Filter alloc] initFor: [Hide new]] run: argv];
}

