Generating sweep commands