command-line-arguments issueshttps://gitlab.common-lisp.net/qitab/command-line-arguments/-/issues2019-01-01T06:01:11Zhttps://gitlab.common-lisp.net/qitab/command-line-arguments/-/issues/1Does anything other than (:positional-arity 0, :rest-arity t) work as expected?2019-01-01T06:01:11ZElias PippingDoes anything other than (:positional-arity 0, :rest-arity t) work as expected?Quoting from #lisp
```
17:13:09 pipping | [..] I couldn't get the keywords :positional-arity and :rest-arity to work for me the way they should [..]
17:19:42 Fare | pipping, sorry it didn't just work :-(
17:29:12...Quoting from #lisp
```
17:13:09 pipping | [..] I couldn't get the keywords :positional-arity and :rest-arity to work for me the way they should [..]
17:19:42 Fare | pipping, sorry it didn't just work :-(
17:29:12 pipping | Fare: well, I really can't tell if it's an issue with c-l-i or me. I invite you to take
| https://github.com/pipping/cl-echo/tree/fancy-command-line-arguments for a spin and see if you can get it to work as expected after changing
| https://github.com/pipping/cl-echo/blob/fancy-command-line-arguments/fancy-echo.lisp#L40-L41
17:46:40 Fare | pipping, fancy-echo looks like it's working for me
17:46:46 Fare | what's your problem with it?
17:49:51 pipping | Fare: it works like this, yes
17:51:51 pipping | Fare: what I'd expect to work e.g., though, yet which doesn't:
17:51:56 pipping | Fare: - http://dpaste.com/1AG1PH6
17:53:03 pipping | Fare: - http://dpaste.com/1V9AJ0V
17:54:17 pipping | Fare: - http://dpaste.com/3GJZQBH
17:55:04 pipping | Fare: so in summary, (:positional-arity 0, :rest-arity t) is the only combination I've gotten to work.
```
In order to reproduce this: The branch `fancy-command-line-arguments` is at revision 88f04f89a968365bd80f973fd6522b5aa24baaf7 at the time of this writing. The pastes contained the following diffs:
```diff
diff --git a/fancy-echo.lisp b/fancy-echo.lisp
index a30830f..3d80602 100644
--- a/fancy-echo.lisp
+++ b/fancy-echo.lisp
@@ -18,7 +18,7 @@
:optional t
:documentation "an option can take a string argument")))
-(defun process-arguments (regular-arguments &key b check warn)
+(defun process-arguments (&key b check warn :allow-other-keys)
(format t "After parsing...
regular-arguments: ~a
b: ~a,
@@ -38,4 +38,4 @@
:command-line unprocessed-arguments
:name "my-program"
:positional-arity 0
- :rest-arity t)))
+ :rest-arity :key)))
```
```diff
diff --git a/fancy-echo.lisp b/fancy-echo.lisp
index a30830f..47750fc 100644
--- a/fancy-echo.lisp
+++ b/fancy-echo.lisp
@@ -18,7 +18,7 @@
:optional t
:documentation "an option can take a string argument")))
-(defun process-arguments (regular-arguments &key b check warn)
+(defun process-arguments (x y &key b check warn)
(format t "After parsing...
regular-arguments: ~a
b: ~a,
@@ -37,5 +37,5 @@
'process-arguments
:command-line unprocessed-arguments
:name "my-program"
- :positional-arity 0
+ :positional-arity 2
:rest-arity t)))
```
```diff
diff --git a/fancy-echo.lisp b/fancy-echo.lisp
index a30830f..c326fea 100644
--- a/fancy-echo.lisp
+++ b/fancy-echo.lisp
@@ -18,7 +18,7 @@
:optional t
:documentation "an option can take a string argument")))
-(defun process-arguments (regular-arguments &key b check warn)
+(defun process-arguments (&key b check warn)
(format t "After parsing...
regular-arguments: ~a
b: ~a,
@@ -38,4 +38,4 @@
:command-line unprocessed-arguments
:name "my-program"
:positional-arity 0
- :rest-arity t)))
+ :rest-arity nil)))
```