chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] add -all option to chicken-uninstall


From: Felix
Subject: [Chicken-hackers] [PATCH] add -all option to chicken-uninstall
Date: Fri, 02 Aug 2013 14:25:22 +0200 (CEST)

This patch adds the "-all" option to chicken-uninstall. This may be a
bit more intuitive than using a ".*" regular-expression.


cheers,
felix
>From ff90930f99a2a0c627df27fea49ec0c9d94e6ed4 Mon Sep 17 00:00:00 2001
From: felix <address@hidden>
Date: Thu, 1 Aug 2013 12:01:37 +0200
Subject: [PATCH] Add "-all" option to "chicken-install", which is somewhat
 more intuitive than using the regular expression ".*" to
 name the extensions to be removed.

---
 chicken-uninstall.scm |    6 ++++++
 manual/Extensions     |    1 +
 2 files changed, 7 insertions(+)

diff --git a/chicken-uninstall.scm b/chicken-uninstall.scm
index f982c0b..477ab3c 100644
--- a/chicken-uninstall.scm
+++ b/chicken-uninstall.scm
@@ -47,6 +47,7 @@
        (make-pathname C_TARGET_LIB_HOME (sprintf "chicken/~a" 
C_BINARY_VERSION))
        (repository-path)))
 
+  (define *all* #t)
   (define *force* #f)
 
   (define (grep rx lst)
@@ -99,6 +100,7 @@ usage: chicken-uninstall [OPTION | PATTERN] ...
 
   -h   -help                    show this message and exit
        -version                 show version and exit
+       -all                     remove all installed eggs
        -force                   don't ask, delete whatever matches
        -exact                   treat PATTERN as exact match (not a pattern)
   -s   -sudo                    use sudo(1) for deleting files
@@ -114,6 +116,7 @@ EOF
     (let ((exact #f))
       (let loop ((args args) (pats '()))
        (cond ((null? args)
+              (when *all* (set! pats '(".*")))
               (when (null? pats) (usage 1))
               (uninstall
                (reverse 
@@ -141,6 +144,9 @@ EOF
                       ((string=? arg "-force")
                        (set! *force* #t)
                        (loop (cdr args) pats))
+                      ((string=? arg "-all")
+                       (set! *all* #t)
+                       (loop (cdr args) pats))
                       ((string=? arg "-exact")
                        (set! exact #t)
                        (loop (cdr args) pats))
diff --git a/manual/Extensions b/manual/Extensions
index 5e612c0..701f79b 100644
--- a/manual/Extensions
+++ b/manual/Extensions
@@ -589,6 +589,7 @@ Available options:
 ; {{-h   -help}} : show usage information and exit
 ; {{-version}} : show version and exit
 ; {{-force}} : don't ask, delete whatever matches
+; {{-all}} : remove all installed eggs
 ; {{-s   -sudo}} : use {{sudo(1)}} for deleting files
 ; {{-host}} : when cross-compiling, remove extensions for host system only
 ; {{-target}} : when cross-compiling, remove extensions for target system only
-- 
1.7.9.5


reply via email to

[Prev in Thread] Current Thread [Next in Thread]