xref: /haiku/src/bin/beep.cpp (revision 4f00613311d0bd6b70fa82ce19931c41f071ea4e)
1 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
2 //
3 //	Copyright (c) 2001-2002, OpenBeOS
4 //
5 //  This software is part of the OpenBeOS distribution and is covered
6 //  by the OpenBeOS license.
7 //
8 //
9 //  File:        beep.cpp
10 //  Author:      Mahmoud Al Gammal
11 //  Description: BeOS' command line "beep" command
12 //  Created : Monday, September 23, 2002
13 //
14 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
15 
16 #include <Beep.h>
17 #include <stdio.h>
18 
19 int
20 main( int argc, char* argv[] )
21 {
22 
23 	// "beep" can only take a single optional event name
24 	if (argc > 2) {
25 		fprintf(stdout,"usage: beep [ eventname ]\n");
26 		fprintf(stdout,"Event names are found in the Sounds preferences panel.\n");
27 		fflush(stdout);
28 		return B_OK;
29 	}
30 
31 	// if no event name is specified, play the default "Beep" event
32 	if (argc == 1) {
33 		return beep();
34 	}	else {
35 		return system_beep(argv[1]);
36 	}
37 }
38 
39 // beep.c
40