From 24aab4e686c623074115e5eb6f476d6125be21a3 Mon Sep 17 00:00:00 2001 From: Kevin Rosenberg Date: Fri, 14 Mar 2008 09:03:56 -0600 Subject: [PATCH] apply patches from Daniel Janus --- debian/changelog | 6 ++++++ debian/control | 2 +- debian/rules | 29 ++++++----------------------- main.lisp | 7 ++++--- tests.lisp | 4 ++++ 5 files changed, 21 insertions(+), 27 deletions(-) diff --git a/debian/changelog b/debian/changelog index eb2c543..3954635 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-getopt (1.2.0-1) unstable; urgency=low + + * New upstream + + -- Kevin M. Rosenberg Fri, 14 Mar 2008 09:00:57 -0600 + cl-getopt (1.1.0-3) unstable; urgency=low * debian/control: use build-depends, update standards-version diff --git a/debian/control b/debian/control index f8f4eb3..8708de9 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: devel Priority: optional Maintainer: Kevin M. Rosenberg Build-Depends: debhelper (>= 4.0.0) -Standards-Version: 3.7.2.2 +Standards-Version: 3.7.3.0 Package: cl-getopt Architecture: all diff --git a/debian/rules b/debian/rules index 2c45968..9ff92d1 100755 --- a/debian/rules +++ b/debian/rules @@ -14,8 +14,6 @@ source-files := $(wildcard *.lisp) configure: configure-stamp configure-stamp: dh_testdir - # Add here commands to configure the package. - touch configure-stamp @@ -23,14 +21,13 @@ build: build-stamp build-stamp: configure-stamp dh_testdir - # Add here commands to compile the package. touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp - # Add here commands to clean up after the build process. + # Clean up after the build process. rm -f debian/$(debpkg).postinst.* debian/$(debpkg).prerm.* dh_clean @@ -38,43 +35,29 @@ install: build dh_testdir dh_testroot dh_clean -k - # Add here commands to install the package into debian/getopt. + # Install the package into debian/getopt. dh_installdirs $(clc-systems) $(clc-files) $(clc-tests) dh_install $(pkg).asd $(source-files) $(clc-files) dh_link $(clc-files)/$(pkg).asd $(clc-systems)/$(pkg).asd -# Build architecture-independent files here. +# Build architecture-independent files binary-indep: build install - - -# Build architecture-dependent files here. -binary-arch: build install dh_testdir dh_testroot -# dh_installdebconf dh_installdocs -# dh_installmenu -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit -# dh_installcron -# dh_installman -# dh_installinfo -# dh_undocumented dh_installchangelogs dh_strip dh_compress dh_fixperms -# dh_makeshlibs dh_installdeb -# dh_perl dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb +# Build architecture-dependent files +binary-arch: build install + binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure diff --git a/main.lisp b/main.lisp index 311b73b..b64ade2 100644 --- a/main.lisp +++ b/main.lisp @@ -28,7 +28,7 @@ (and (> (length arg) 2) (char= #\- (schar arg 0)) (char= #\- (schar arg 1)) - (char/= #\- (schar arg 3)))) + (char/= #\- (schar arg 2)))) (defun decompose-arg (arg option-type) "Returns base-name,argument" @@ -120,11 +120,12 @@ opts is a list of option lists. The fields of the list are ((null argument) (if (and (eq :required (second option-list)) (null (cdr pos))) (push base-name errors) - (if (or (is-short-option (second pos)) + (if (or (eq :none (second option-list)) + (is-short-option (second pos)) (is-long-option (second pos))) (if (eq :required (second option-list)) (push base-name errors) - (push (cons base-name (third option-list)) out-args)) + (push (cons base-name (third option-list)) out-opts)) (progn (push (cons base-name (second pos)) out-opts) (setq pos (cdr pos)))))))) diff --git a/tests.lisp b/tests.lisp index f8f6574..7b1610b 100644 --- a/tests.lisp +++ b/tests.lisp @@ -68,5 +68,9 @@ (getopt '("--a=10") '(("along" :optional) ("aboot" :optional)))) (test-mv '(("a") nil nil) (getopt '("a") '(("a" :none)))) + (test-mv '(("a") (("foo") ("bar")) nil) + (getopt '("a" "--foo" "--bar") '(("foo" :none) ("bar" :none)))) + (test-mv '(("a") (("foo") ("bar")) nil) + (getopt '("a" "--f" "--bar") '(("foo" :none) ("bar" :none)))) )) t) -- 2.34.1