1 /* 2 * Copyright 2002-2006, Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Mahmoud Al Gammal 7 */ 8 9 10 #include <Beep.h> 11 12 #include <stdio.h> 13 14 15 int 16 main(int argc, char* argv[]) 17 { 18 19 // "beep" can only take a single optional event name 20 if (argc > 2 21 || (argc == 2 && argv[1][0] == '-')) { 22 fprintf(stdout,"usage: beep [ eventname ]\n"); 23 fprintf(stdout,"Event names are found in the Sounds preferences panel.\n"); 24 fflush(stdout); 25 return B_OK; 26 } 27 28 // if no event name is specified, play the default "Beep" event 29 if (argc == 1) 30 return beep(); 31 else 32 return system_beep(argv[1]); 33 } 34