- while (argc > 0 && **argv == '-') {
- while (*++(*argv)) {
- switch (**argv) {
-#ifdef CONFIG_KILLALL
- case 'q':
- quiet++;
- break;
-#endif
- case 'l':
- if(argc>1) {
- for(argv++; *argv; argv++) {
- name = u_signal_names(*argv, &sig, -1);
- if(name!=NULL)
- printf("%s\n", name);
- }
- } else {
- int col = 0;
- for(sig=1; sig < NSIG; sig++) {
- name = u_signal_names(0, &sig, 1);
- if(name==NULL) /* unnamed */
- continue;
- col += printf("%2d) %-16s", sig, name);
- if (col > 60) {
- printf("\n");
- col = 0;
- }
- }
- printf("\n");
- }
- return EXIT_SUCCESS;
- case '-':
- show_usage();
- default:
- name = u_signal_names(*argv, &sig, 0);
- if(name==NULL)
- error_msg_and_die( "bad signal name: %s", *argv);
- argc--;
- argv++;
- goto do_it_now;
+ if(argv[1][0] != '-'){
+ argv++;
+ argc--;
+ goto do_it_now;
+ }
+
+ /* The -l option, which prints out signal names. */
+ if(argv[1][1]=='l' && argv[1][2]=='\0'){
+ if(argc==2) {
+ /* Print the whole signal list */
+ int col = 0;
+ for(signo=1; signo < NSIG; signo++) {
+ name = u_signal_names(0, &signo, 1);
+ if(name==NULL) /* unnamed */
+ continue;
+ col += printf("%2d) %-16s", signo, name);
+ if (col > 60) {
+ printf("\n");
+ col = 0;
+ }