#import <appkit/appkit.h>
#import "PBNames.h"

int main (int argc, char * argv [])
{	
	if (argc > 1)
	{	char * fnm = argv[1];
		NXAtom pbKey = argc <= 2 ? NXGeneralPboard :
			argv[2][0] == '-' ? [[PBNames new] key:argv[2]+1] :
			NXUniqueString(argv[2]);
		id pb = [Pasteboard newName:pbKey];

		if (! [pb writeFileContents:fnm])
			[pb error:"%s: not written\n", fnm];
	}
	return 0;
}
