Commits

Evan Gates  committed 24b4201

added -b for bell on new output

  • Participants
  • Parent commits 0dc4d81

Comments (0)

Files changed (2)

 .B srw
 .RB [ \-p
 .IR prompt ]
+.RB [ \-b ]
 .IR cmd
 .RI [ args... ]
 .P
 .BI \-p " prompt"
 override the default prompt (>)
 .TP
+.BI \-b
+write bell (^G) when there is new output (helpful if your terminal can set urgent hint on bell)
+.TP
 .BI \-v
 print version information and exit
 
 int mfd;
 pid_t child;
 
+int bell = 0;
+
 void usage(void)
 {
 	printf("Usage: srw [-p prompt] cmd [args]...\n");
 
 			erase_usr();
 			my_write(STDOUT, buf, rdlen);
+			if (bell)
+				my_write(STDOUT, "\07", strlen("\07"));
 			print_usr();
 		}
 	}
 			usage();
 		switch (argv[i][1]) {
 			case 'p' : nrml_prompt = argv[++i]; break;
+			case 'b' : bell = 1; break;
 			case 'v' : printf("srw-"VERSION" © Evan Gates\n"); exit(1);
 			default  : usage();
 		}