changeset 642:b2b01d76a861

Added switch to enable script tracing.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Wed, 04 Oct 2017 14:52:09 +0300
parents 8a0743f64040
children 073940496d59
files hg/hgsyncee hg/hgsyncee.1 hg/hgsyncew hg/hgsyncew.1
diffstat 4 files changed, 21 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hg/hgsyncee	Sun Aug 27 20:35:24 2017 +0300
+++ b/hg/hgsyncee	Wed Oct 04 14:52:09 2017 +0300
@@ -14,8 +14,9 @@
 Usage() {
     echo Sync external repo-set with master repo-set via intermediate repo-set.
     echo "Usage:"
-    echo "$UTIL_NAME [--help]"
+    echo "$UTIL_NAME [--help | --debug]"
     echo "  --help    print this help"
+    echo "  --debug   print script execution trace"
 }
 
 PrintLog() {
@@ -123,6 +124,10 @@
         Usage
         exit 0;
         ;;
+    -x|--debug)
+        set -x
+        set -u
+        ;;
 esac
 
 RotateLog
--- a/hg/hgsyncee.1	Sun Aug 27 20:35:24 2017 +0300
+++ b/hg/hgsyncee.1	Wed Oct 04 14:52:09 2017 +0300
@@ -8,7 +8,7 @@
 .SH NAME
 hgsyncee \- synchronize set of Mercurial repositories
 .SH SYNOPSIS
-.B hgsyncee [ --help ]
+.B hgsyncee [ --help | --debug ]
 .SH DESCRIPTION
 Typical use of
 .B hgsyncee
@@ -36,6 +36,8 @@
 .SH OPTIONS
 .IP --help
 Print help.
+.IP "-x, --debug"
+Print script execution trace.
 \" .SH EXAMPLES
 .SH FILES
 Searching for config take place in such order:
--- a/hg/hgsyncew	Sun Aug 27 20:35:24 2017 +0300
+++ b/hg/hgsyncew	Wed Oct 04 14:52:09 2017 +0300
@@ -20,6 +20,7 @@
     echo "  --help    print this help"
     echo "  --push    back changeset to master repo set"
     echo "  --modified  print if local changes present"
+    echo "  --debug   print script execution trace"
 }
 
 PrintLog() {
@@ -133,6 +134,14 @@
 }
 
 case "${1-}" in
+    -x|--debug)
+        set -x
+        set -u
+        shift
+        ;;
+esac
+
+case "${1-}" in
     -h|--help)
         Usage
         exit 0;
--- a/hg/hgsyncew.1	Sun Aug 27 20:35:24 2017 +0300
+++ b/hg/hgsyncew.1	Wed Oct 04 14:52:09 2017 +0300
@@ -8,7 +8,7 @@
 .SH NAME
 hgsyncew \- synchronize a working set of Mercurial repositories
 .SH SYNOPSIS
-.B hgsyncew [ --help ] [ --push ]
+.B hgsyncew [ --help | --debug ] [ --push ]
 .SH DESCRIPTION
 Typical use of
 .B hgsyncew
@@ -28,6 +28,8 @@
 Print help.
 .IP --push
 Push changes back to main repositories.
+.IP "-x, --debug"
+Print script execution trace.
 .SH EXAMPLES
 .nf
 .B $ cd $dir