1f3011ac0SStefano Ceccherini /* 2f3011ac0SStefano Ceccherini * Copyright 2002-2006, Haiku Inc. All rights reserved. 3f3011ac0SStefano Ceccherini * Distributed under the terms of the MIT License. 4f3011ac0SStefano Ceccherini * 5f3011ac0SStefano Ceccherini * Authors: 6f3011ac0SStefano Ceccherini * Mahmoud Al Gammal 7f3011ac0SStefano Ceccherini */ 8f3011ac0SStefano Ceccherini 917049c45SAxel Dörfler 1017049c45SAxel Dörfler #include <Beep.h> 11f3011ac0SStefano Ceccherini 1217049c45SAxel Dörfler #include <stdio.h> 1317049c45SAxel Dörfler 14f3011ac0SStefano Ceccherini 1517049c45SAxel Dörfler int 1617049c45SAxel Dörfler main(int argc, char* argv[]) 1717049c45SAxel Dörfler { 1817049c45SAxel Dörfler // "beep" can only take a single optional event name 19f3011ac0SStefano Ceccherini if (argc > 2 20f3011ac0SStefano Ceccherini || (argc == 2 && argv[1][0] == '-')) { 2117049c45SAxel Dörfler fprintf(stdout, "usage: beep [ eventname ]\n"); 22*e0153fadSAlexander von Gluck IV fprintf(stdout, "Event names are found in the " 23*e0153fadSAlexander von Gluck IV "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 29f3011ac0SStefano Ceccherini if (argc == 1) 3017049c45SAxel Dörfler return beep(); 31f3011ac0SStefano Ceccherini else 3217049c45SAxel Dörfler return system_beep(argv[1]); 3317049c45SAxel Dörfler } 34