1*f3011ac0SStefano Ceccherini /* 2*f3011ac0SStefano Ceccherini * Copyright 2002-2006, Haiku Inc. All rights reserved. 3*f3011ac0SStefano Ceccherini * Distributed under the terms of the MIT License. 4*f3011ac0SStefano Ceccherini * 5*f3011ac0SStefano Ceccherini * Authors: 6*f3011ac0SStefano Ceccherini * Mahmoud Al Gammal 7*f3011ac0SStefano Ceccherini */ 8*f3011ac0SStefano Ceccherini 917049c45SAxel Dörfler 1017049c45SAxel Dörfler #include <Beep.h> 11*f3011ac0SStefano Ceccherini 1217049c45SAxel Dörfler #include <stdio.h> 1317049c45SAxel Dörfler 14*f3011ac0SStefano Ceccherini 1517049c45SAxel Dörfler int 1617049c45SAxel Dörfler main(int argc, char* argv[]) 1717049c45SAxel Dörfler { 1817049c45SAxel Dörfler 1917049c45SAxel Dörfler // "beep" can only take a single optional event name 20*f3011ac0SStefano Ceccherini if (argc > 2 21*f3011ac0SStefano Ceccherini || (argc == 2 && argv[1][0] == '-')) { 2217049c45SAxel Dörfler fprintf(stdout,"usage: beep [ eventname ]\n"); 2317049c45SAxel Dörfler fprintf(stdout,"Event names are found in the Sounds preferences panel.\n"); 2417049c45SAxel Dörfler fflush(stdout); 2517049c45SAxel Dörfler return B_OK; 2617049c45SAxel Dörfler } 2717049c45SAxel Dörfler 2817049c45SAxel Dörfler // if no event name is specified, play the default "Beep" event 29*f3011ac0SStefano Ceccherini if (argc == 1) 3017049c45SAxel Dörfler return beep(); 31*f3011ac0SStefano Ceccherini else 3217049c45SAxel Dörfler return system_beep(argv[1]); 3317049c45SAxel Dörfler } 34