xref: /haiku/src/bin/beep.cpp (revision 220d04022750f40f8bac8f01fa551211e28d04f2)
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 	// "beep" can only take a single optional event name
19 	if (argc > 2
20 		|| (argc == 2 && argv[1][0] == '-')) {
21 		fprintf(stdout, "usage: beep [ eventname ]\n");
22 		fprintf(stdout, "Event names are found in the "
23 			"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