From a228429ee2fff273cb1d1960f7eaa243ab5acd49 Mon Sep 17 00:00:00 2001 From: djcb Date: Wed, 9 Oct 2013 23:27:00 +0300 Subject: [PATCH] * guile: update command-line arguments in scripts --- guile/scripts/msgs-count.scm | 6 +++--- guile/scripts/msgs-per-hour.scm | 13 +++++++------ guile/scripts/msgs-per-month.scm | 13 +++++++------ guile/scripts/msgs-per-year-month.scm | 13 +++++++------ guile/scripts/msgs-per-year.scm | 13 +++++++------ 5 files changed, 31 insertions(+), 27 deletions(-) diff --git a/guile/scripts/msgs-count.scm b/guile/scripts/msgs-count.scm index 4d4be164..407421ef 100755 --- a/guile/scripts/msgs-count.scm +++ b/guile/scripts/msgs-count.scm @@ -19,18 +19,18 @@ exec guile -e main -s $0 $@ ;; along with this program; if not, write to the Free Software Foundation, ;; Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -;; INFO: count the number of messages matching some query +;; INFO: graph the number of messages per day (using gnuplot) ;; INFO: options: ;; INFO: --query=: limit to messages matching query ;; INFO: --muhome=: path to mu home dir (use-modules (mu) (mu script) (mu stats)) -(define (count expr text-only) +(define (count expr) "Print the total number of messages matching QUERY." (display (mu:count expr)) (newline)) - + (define (main args) (mu:run-stats args count)) diff --git a/guile/scripts/msgs-per-hour.scm b/guile/scripts/msgs-per-hour.scm index d0446032..d96f9b6b 100755 --- a/guile/scripts/msgs-per-hour.scm +++ b/guile/scripts/msgs-per-hour.scm @@ -19,18 +19,19 @@ exec guile -e main -s $0 $@ ;; along with this program; if not, write to the Free Software Foundation, ;; Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -;; INFO: graph the number of messages per hour +;; INFO: graph the number of messages per day (using gnuplot) ;; INFO: options: ;; INFO: --query=: limit to messages matching query ;; INFO: --muhome=: path to mu home dir -;; INFO: --textonly: output in text-only format +;; INFO: --output: the output format, such as "png", "wxt" +;; INFO: (depending on the environment) (use-modules (mu) (mu script) (mu stats) (mu plot)) -(define (per-hour expr text-only) +(define (per-hour expr output) "Count the total number of messages for each weekday (0-6 for -Sun..Sat) that match EXPR. If PLAIN-TEXT is true, use a plain-text -display, otherwise, use a graphical window." +Sun..Sat) that match EXPR. OUTPUT corresponds to the output format, as +per gnuplot's 'set terminal'." (mu:plot-histogram (sort (mu:tabulate @@ -38,7 +39,7 @@ display, otherwise, use a graphical window." (tm:hour (localtime (mu:date msg)))) expr) (lambda (x y) (< (car x) (car y)))) (format #f "Messages per hour matching ~a" expr) - "Hour" "Messages" text-only)) + "Hour" "Messages" output)) (define (main args) (mu:run-stats args per-hour)) diff --git a/guile/scripts/msgs-per-month.scm b/guile/scripts/msgs-per-month.scm index aa91de1e..50dbbedb 100755 --- a/guile/scripts/msgs-per-month.scm +++ b/guile/scripts/msgs-per-month.scm @@ -19,18 +19,19 @@ exec guile -e main -s $0 $@ ;; along with this program; if not, write to the Free Software Foundation, ;; Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -;; INFO: graph the number of messages per month +;; INFO: graph the number of messages per day (using gnuplot) ;; INFO: options: ;; INFO: --query=: limit to messages matching query ;; INFO: --muhome=: path to mu home dir -;; INFO: --textonly: output in text-only format +;; INFO: --output: the output format, such as "png", "wxt" +;; INFO: (depending on the environment) (use-modules (mu) (mu script) (mu stats) (mu plot)) -(define (per-month expr text-only) +(define (per-month expr output) "Count the total number of messages for each weekday (0-6 for -Sun..Sat) that match EXPR. If PLAIN-TEXT is true, use a plain-text -display, otherwise, use a graphical window." +Sun..Sat) that match EXPR. OUTPUT corresponds to the output format, as +per gnuplot's 'set terminal'." (mu:plot-histogram (mu:month-numbers->names (sort @@ -39,7 +40,7 @@ display, otherwise, use a graphical window." (tm:mon (localtime (mu:date msg)))) expr) (lambda (x y) (< (car x) (car y))))) (format #f "Messages per month matching ~a" expr) - "Month" "Messages" text-only)) + "Month" "Messages" output)) (define (main args) (mu:run-stats args per-month)) diff --git a/guile/scripts/msgs-per-year-month.scm b/guile/scripts/msgs-per-year-month.scm index 50de66cb..33b14476 100755 --- a/guile/scripts/msgs-per-year-month.scm +++ b/guile/scripts/msgs-per-year-month.scm @@ -19,18 +19,19 @@ exec guile -e main -s $0 $@ ;; along with this program; if not, write to the Free Software Foundation, ;; Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -;; INFO: graph the number of messages per year-month +;; INFO: graph the number of messages per day (using gnuplot) ;; INFO: options: ;; INFO: --query=: limit to messages matching query ;; INFO: --muhome=: path to mu home dir -;; INFO: --textonly: output in text-only format +;; INFO: --output: the output format, such as "png", "wxt" +;; INFO: (depending on the environment) (use-modules (mu) (mu script) (mu stats) (mu plot)) -(define (per-year-month expr text-only) +(define (per-year-month expr output) "Count the total number of messages for each weekday (0-6 for -Sun..Sat) that match EXPR. If PLAIN-TEXT is true, use a plain-text -display, otherwise, use a graphical window." +Sun..Sat) that match EXPR. OUTPUT corresponds to the output format, as +per gnuplot's 'set terminal'." (mu:plot-histogram (sort (mu:tabulate (lambda (msg) @@ -41,7 +42,7 @@ display, otherwise, use a graphical window." expr) (lambda (x y) (< (car x) (car y)))) (format #f "Messages per year/month matching ~a" expr) - "Year/Month" "Messages" text-only)) + "Year/Month" "Messages" output)) (define (main args) (mu:run-stats args per-year-month)) diff --git a/guile/scripts/msgs-per-year.scm b/guile/scripts/msgs-per-year.scm index 6d6dc1a2..242e2998 100755 --- a/guile/scripts/msgs-per-year.scm +++ b/guile/scripts/msgs-per-year.scm @@ -19,25 +19,26 @@ exec guile -e main -s $0 $@ ;; along with this program; if not, write to the Free Software Foundation, ;; Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -;; INFO: graph the number of messages per year +;; INFO: graph the number of messages per day (using gnuplot) ;; INFO: options: ;; INFO: --query=: limit to messages matching query ;; INFO: --muhome=: path to mu home dir -;; INFO: --textonly: output in text-only format +;; INFO: --output: the output format, such as "png", "wxt" +;; INFO: (depending on the environment) (use-modules (mu) (mu script) (mu stats) (mu plot)) -(define (per-year expr text-only) +(define (per-year expr output) "Count the total number of messages for each weekday (0-6 for -Sun..Sat) that match EXPR. If TEXT-ONLY is true, use a plain-text -display, otherwise, use a graphical window." +Sun..Sat) that match EXPR. OUTPUT corresponds to the output format, as +per gnuplot's 'set terminal'." (mu:plot-histogram (sort (mu:tabulate (lambda (msg) (+ 1900 (tm:year (localtime (mu:date msg))))) expr) (lambda (x y) (< (car x) (car y)))) (format #f "Messages per year matching ~a" expr) - "Year" "Messages" text-only)) + "Year" "Messages" output)) (define (main args) (mu:run-stats args per-year))