Changeset 86fe9d1 in mainline
- Timestamp:
- 2012-08-19T16:11:31Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ad1aedc
- Parents:
- 1ba95ba
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/wavplay/main.c
r1ba95ba r86fe9d1 67 67 } 68 68 69 70 69 static void data_callback(void* arg, void *buffer, ssize_t size) 71 70 { … … 124 123 {"device", required_argument, 0, 'd'}, 125 124 {"record", no_argument, 0, 'r'}, 125 {"help", no_argument, 0, 'h'}, 126 126 {0, 0, 0, 0} 127 127 }; 128 128 129 static void print_help(const char* name) 130 { 131 printf("Usage: %s [options] file\n", name); 132 printf("supported options:\n"); 133 printf("\t -h, --help\t Print this help.\n"); 134 printf("\t -r, --record\t Start recording instead of playback.\n"); 135 printf("\t -d, --device\t Use specified device instead of sound " 136 "service. Use location path or special device `default'\n"); 137 } 129 138 130 139 int main(int argc, char *argv[]) … … 136 145 int ret = 0; 137 146 while (ret != -1) { 138 ret = getopt_long(argc, argv, "d:r ", opts, &idx);147 ret = getopt_long(argc, argv, "d:rh", opts, &idx); 139 148 switch (ret) { 140 149 case 'd': … … 145 154 record = true; 146 155 break; 156 case 'h': 157 print_help(*argv); 158 return 0; 147 159 }; 148 160 } … … 150 162 if (optind == argc) { 151 163 printf("Not enough arguments.\n"); 164 print_help(*argv); 152 165 return 1; 153 166 }
Note:
See TracChangeset
for help on using the changeset viewer.