@@ -97,7 +97,7 @@ void print_autocomplete_fish() {
9797 " set -l cmd (commandline -opc)\n"
9898 " for i in $cmd\n"
9999 " switch $i\n"
100- " case --help --stdout --silent --fail --status --any --change --diff --exec --interval --forever --service\n"
100+ " case --help --stdout --silent --fail --status --any --change --diff --exec --interval --forever --service --watch \n"
101101 " return 1\n"
102102 " end\n"
103103 " end\n"
@@ -117,6 +117,7 @@ void print_autocomplete_fish() {
117117 "complete -c await -n '__fish_await_no_subcommand' -l forever -s F -d 'Do not exit ever'\n"
118118 "complete -c await -n '__fish_await_no_subcommand' -l service -s S -d 'Create systemd user service with same parameters and activate it'\n"
119119 "complete -c await -n '__fish_await_no_subcommand' -l no-stderr -s E -d 'Surpress stderr of commands by adding 2>/dev/null to commands'\n"
120+ "complete -c await -n '__fish_await_no_subcommand' -l watch -s w -d 'Equivalent to -fVodE (fail, silent, stdout, diff, no-stderr)'\n"
120121 "\n"
121122 "# For command completion\n"
122123 "complete -c await -f -a '(__fish_complete_command)'\n" );
@@ -129,7 +130,7 @@ void print_autocomplete_bash() {
129130 " cur=\"${COMP_WORDS[COMP_CWORD]}\"\n"
130131 " prev=\"${COMP_WORDS[COMP_CWORD-1]}\"\n"
131132 "\n"
132- " opts=\"--help --stdout --silent --fail --status --any --change --diff --exec --interval --forever --service --version --no-stderr\"\n"
133+ " opts=\"--help --stdout --silent --fail --status --any --change --diff --exec --interval --forever --service --version --no-stderr --watch \"\n"
133134 "\n"
134135 " case \"${prev}\" in\n"
135136 " --status|--exec|--interval)\n"
@@ -171,6 +172,7 @@ void print_autocomplete_zsh() {
171172 " '--exec[Run some shell command on success]::command:_command_names' \\\n"
172173 " '--interval[Milliseconds between rounds of commands (default: 200)]::interval' \\\n"
173174 " '--forever[Do not exit ever]' \\\n"
175+ " '--watch[Equivalent to -fVodE (fail, silent, stdout, diff, no-stderr)]' \\\n"
174176 " '--service[Create systemd user service with same parameters and activate it]'\n"
175177 "}\n"
176178 "\n"
@@ -350,6 +352,7 @@ void help() {
350352 " --help\t\t#print this help\n"
351353 " --stdout -o\t\t#print stdout of commands\n"
352354 " --no-stderr -E\t#suppress stderr output from commands\n"
355+ " --watch -w\t\t#equivalent to -fVodE (fail, silent, stdout, diff, no-stderr)\n"
353356 " --silent -V\t\t#do not print spinners and commands\n"
354357 " --fail -f\t\t#waiting commands to fail\n"
355358 " --status -s\t\t#expected status [default: 0]\n"
@@ -403,14 +406,15 @@ void parse_args(int argc, char *argv[]) {
403406 {"exec" , required_argument , 0 , 'e' },
404407 {"interval" ,required_argument , 0 , 'i' },
405408 {"no-stderr" , no_argument , 0 , 'E' },
409+ {"watch" , no_argument , 0 , 'w' },
406410 {"autocomplete-fish" , no_argument , 0 , 0 },
407411 {"autocomplete-bash" , no_argument , 0 , 0 },
408412 {"autocomplete-zsh" , no_argument , 0 , 0 },
409413 {0 , 0 , 0 , 0 }
410414 };
411415
412416 int option_index = 0 ;
413- getopt = getopt_long (argc , argv , "oVafFchdvS:s:e:i:E " , long_options , & option_index );
417+ getopt = getopt_long (argc , argv , "oVafFchdvS:s:e:i:Ew " , long_options , & option_index );
414418
415419 if (getopt == -1 )
416420 break ;
@@ -454,7 +458,7 @@ void parse_args(int argc, char *argv[]) {
454458 case 'S' : args .service = optarg ; break ;
455459 case 'i' : args .interval = atoi (optarg ); break ;
456460 case 'd' : args .diff = 1 ; break ;
457- case 'v' : printf ("2.0 .0\n" ); exit (0 ); break ;
461+ case 'v' : printf ("2.1 .0\n" ); exit (0 ); break ;
458462 case 'h' : case '?' : help (); break ;
459463 case 1 :
460464 if (strcmp (long_options [option_index ].name , "autocomplete-fish" ) == 0 ) {
@@ -475,6 +479,13 @@ void parse_args(int argc, char *argv[]) {
475479 }
476480 break ;
477481 case 'E' : args .no_stderr = 1 ; break ;
482+ case 'w' :
483+ args .fail = 1 ;
484+ args .silent = 1 ;
485+ args .stdout = 1 ;
486+ args .diff = 1 ;
487+ args .no_stderr = 1 ;
488+ break ;
478489 }
479490 }
480491
0 commit comments