[hackers] [scc] Add optional parameter to update.sh || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Sat, 3 Oct 2015 12:13:12 +0200 (CEST)

commit fa0027223d9664bec5f475be753b5f6258584cb5
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Sat Oct 3 12:06:01 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Sat Oct 3 12:12:46 2015 +0200

    Add optional parameter to update.sh
    
    This tool is good when you want to update only one test,
    so the previous behaviour of updating all the tests
    was not always the desired result.

diff --git a/cc1/tests/update.sh b/cc1/tests/update.sh
index 780320f..c2c882c 100755
--- a/cc1/tests/update.sh
+++ b/cc1/tests/update.sh
_AT_@ -1,8 +1,26 @@
 #!/bin/sh
 
+update()
+{
+ (echo '/^output/+;/^\*\//-c'
+ ../cc1 -I./ -w $1 2>&1
+ printf ".\nw\n") | ed -s $1
+}
+
+
+case $# in
+1)
+ update $1
+ exit
+ ;;
+*)
+ echo "usage: update.sh [test]" >&2
+ exit 1
+ ;;
+esac
+
+
 for i in *.c
 do
- (echo '/^output/+;/^\*\//-c'
- ../cc1 -w $i 2>&1
- printf ".\nw\n") | ed -s $i
+ update $i
 done
Received on Sat Oct 03 2015 - 12:13:12 CEST

This archive was generated by hypermail 2.3.0 : Sat Oct 03 2015 - 12:24:14 CEST