1. Evan Gates
  2. srw


Evan Gates  committed 82792ad

get rid of bell option, this can be done with sed

  • Participants
  • Parent commits 672738c
  • Branches default
  • Tags 0.4

Comments (0)

Files changed (2)

File srw.1

View file
  • Ignore whitespace
 .SY srw
 .OP \-p prompt
-.OP \-b
 .OP \-v
 .I cmd
 .RI [ args... ]
 .BI \-p " prompt"
 override the default prompt (>)
-.B \-b
-write bell (^G) when there is new output (helpful if your terminal can set urgent hint on bell)
 .B \-v
 print version information and exit

File srw.c

View file
  • Ignore whitespace
 #define MIN(x,y) ((x) < (y) ? (x) : (y))
 #define MAX(x,y) ((x) > (y) ? (x) : (y))
-#define BELL        CTRL('g')
 #define BACKSPACE   CTRL('h')
-#define TAB         CTRL('i')
 #define LINEFEED    CTRL('j')
 #define RETURN      CTRL('m')
 #define ESC         0x1b
 #define cursor_clr()  printf("\033[J")
 #define cursor_beg()  printf("\033[1G")
 #define cursor_fwd(n) printf("\033[%dC", MAX(1, (n)))
-#define cursor_bak(n) printf("\033[%dD", MAX(1, (n)))
 char  buf[4096], usrbuf[4096];
 char  scrl_prompt_left[]  = "<";
 int mfd;
 pid_t child;
-int bell = 0;
 void usage(void)
 	printf("Usage: srw [-p prompt] cmd [args]...\n");
 			my_write(STDOUT, buf, rdlen);
-			if (bell)
-				my_write(STDOUT, "\07", strlen("\07"));
 		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();