Coder Social home page Coder Social logo

clon's People

Contributors

didierverna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

clon's Issues

Error when quickloading on CCL on Windows

Clozure Common Lisp Version 1.11-r16635 (WindowsX8664)

? (ql:quickload :net.didierverna.clon)
To load "net.didierverna.clon":
  Load 1 ASDF system:
    cffi
  Install 1 Quicklisp release:
    cl-clon
; Fetching #<URL "http://beta.quicklisp.org/archive/cl-clon/2015-07-09/clon-1.0b24.tgz">
; 186.53KB
==================================================
191,003 bytes in 0.12 seconds (1492.21KB/sec)
; Loading "net.didierverna.clon"
[package net.didierverna.clon.setup]..............
[package net.didierverna.clon]....................
.........................
Read error between positions 4979 and 7234 in C:/Users/phoe/quicklisp/dists/quicklisp/software/clon-1.0b24/termio/termio.lisp.
> Error: Foreign variable "TIOCGWINSZ" not found
> While executing: CCL::%LOAD-VAR, in process listener(1).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.

[question] non-ansi features

  1. When I have commented out check for CC variable in setup/setup.lisp for SBCL everything seems to work just fine even if CC is not set (i.e colors). Do I miss something?
  2. As far as I understand, termio can be configured with cffi-grovel - why is this restricted in termio/net.didierverna.clon.termio.asd only to allegro, clisp and lispworks โ€“ shouldn't it be cffi-grovel responsibility to verify if implementation is supported?
  3. Can SBCL use cffi-grovel like other implementations or it uses sb-grovel module for a reason beyond keeping dependencies minimal?

Thanks for CLON, I find it very useful (and it has a great documentation, what is a very rare thing).

Support options anywhere on the command-line

Hi,

It would be nice if CLON supported having options anywhere on the
command line.

For example, suppose I want to add an option at the end of a command I
just typed. Assume the command has file arguments. And suppose it
gave me more output than I wanted, so I want to also pass the -q
option meaning "quiet". In the terminal, I would like to type:

C-p SPC -q RET

instead of, e.g.:

C-p C-a M-f SPC -q RET

This feature would allow CLON to match the behaviour of other
command-line parsing libraries which accept options anywhere except
after "--".

Windows's cmd.exe support

Hey,

is CLON able to intercept command line arguments from Windows's CMD.exe? Or was it not tested at all?

~phoe

Mention license also in sub-systems?

Hi Didi,

the CLON asdf says that the license is BSD.
Would you mind repeating that in net.didierverna.clon.setup and net.didierverna.clon.setup/termio?

I've got short function that reports the licenses of all the systems in use, and these two come up as NIL.

Thanks a lot!

xswitch options doesn't accept :argument-style and :fallback-value properties

If I try to load:

(in-package :cl-user)
(defpackage :bug (:use :cl))
(in-package :bug)

(eval-when (:execute :load-toplevel :compile-toplevel)
  (net.didierverna.clon:nickname-package))

(clon:defsynopsis ()
  (text :contents
	"Some texts")
  (xswitch :short-name "s" :long-name "xswitch"
	       :description "A xswitch option."
           :enum '(:a :b :c)
           :argument-style :yes/no))

I obtain the following error:

Unknown &KEY argument: :ARGUMENT-STYLE
   [Condition of type SB-EXT:UNKNOWN-KEYWORD-ARGUMENT]

Restarts:
 0: [CONTINUE] Ignore all unknown keywords
 1: [RETRY] Retry EVAL of current toplevel form.
 2: [CONTINUE] Ignore error and continue loading file "/home/admich/tmp/prova.lisp".
 3: [ABORT] Abort loading file "/home/admich/tmp/prova.lisp".
 4: [*ABORT] Return to SLIME's top level.
 5: [ABORT] abort thread (#<THREAD "worker" RUNNING {100CCC3893}>)

Backtrace:
  0: (NET.DIDIERVERNA.CLON:MAKE-XSWITCH :SHORT-NAME "s" :LONG-NAME "xswitch" :DESCRIPTION "A xswitch option." :ENUM (:A :B :C) :ARGUMENT-STYLE :YES/NO) [more]
  1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (NET.DIDIERVERNA.CLON:MAKE-XSWITCH :SHORT-NAME "s" :LONG-NAME "xswitch" :DESCRIPTION ...) #<NULL-LEXENV>)
  2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (NET.DIDIERVERNA.CLON:DEFSYNOPSIS NIL (TEXT :CONTENTS "Some texts") (XSWITCH :SHORT-NAME "s" :LONG-NAME "xswitch" :DESCRIPTION ...)) #<NULL-LEXENV>)
  3: (SB-EXT:EVAL-TLF (NET.DIDIERVERNA.CLON:DEFSYNOPSIS NIL (TEXT :CONTENTS "Some texts") (XSWITCH :SHORT-NAME "s" :LONG-NAME "xswitch" :DESCRIPTION ...)) 4 NIL)
  4: ((LABELS SB-FASL::EVAL-FORM :IN SB-INT:LOAD-AS-SOURCE) (NET.DIDIERVERNA.CLON:DEFSYNOPSIS NIL (TEXT :CONTENTS "Some texts") (XSWITCH :SHORT-NAME "s" :LONG-NAME "xswitch" :DESCRIPTION ...)) 4)
  5: ((LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) (NET.DIDIERVERNA.CLON:DEFSYNOPSIS NIL (TEXT :CONTENTS "Some texts") (XSWITCH :SHORT-NAME "s" :LONG-NAME "xswi..
  6: (SB-C::%DO-FORMS-FROM-INFO #<FUNCTION (LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) {100CCD33BB}> #<SB-C::SOURCE-INFO {100CCD3383}> SB-C::INPUT-ERROR-IN-LOA..
  7: (SB-INT:LOAD-AS-SOURCE #<SB-INT:FORM-TRACKING-STREAM for "file /home/admich/tmp/prova.lisp" {100CCD20E3}> :VERBOSE NIL :PRINT NIL :CONTEXT "loading")
  8: ((FLET SB-FASL::THUNK :IN LOAD))
  9: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<FUNCTION (FLET SB-FASL::THUNK :IN LOAD) {7F9961ADE15B}> #<SB-INT:FORM-TRACKING-STREAM for "file /home/admich/tmp/prova.lisp" {100CCD20E3}>)
 10: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #<SB-INT:FORM-TRACKING-STREAM for "file /home/admich/tmp/prova.lisp" {100CCD20E3}> NIL)
 11: (LOAD #P"/home/admich/tmp/prova.lisp" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEFAULT)
 --more--

and with:

(in-package :cl-user)
(defpackage :bug (:use :cl))
(in-package :bug)

(eval-when (:execute :load-toplevel :compile-toplevel)
  (net.didierverna.clon:nickname-package))

(clon:defsynopsis ()
  (text :contents
	"Some texts")
  (xswitch :short-name "s" :long-name "xswitch"
	       :description "A xswitch option."
           :enum '(:a :b :c)
           :fallback-value :a))

I obtain:

Unknown &KEY argument: :FALLBACK-VALUE
   [Condition of type SB-EXT:UNKNOWN-KEYWORD-ARGUMENT]

Restarts:
 0: [CONTINUE] Ignore all unknown keywords
 1: [RETRY] Retry EVAL of current toplevel form.
 2: [CONTINUE] Ignore error and continue loading file "/home/admich/tmp/prova.lisp".
 3: [ABORT] Abort loading file "/home/admich/tmp/prova.lisp".
 4: [*ABORT] Return to SLIME's top level.
 5: [ABORT] abort thread (#<THREAD "worker" RUNNING {100D4892C3}>)

Backtrace:
  0: (NET.DIDIERVERNA.CLON:MAKE-XSWITCH :SHORT-NAME "s" :LONG-NAME "xswitch" :DESCRIPTION "A xswitch option." :ENUM (:A :B :C) :FALLBACK-VALUE :A) [more]
  1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (NET.DIDIERVERNA.CLON:MAKE-XSWITCH :SHORT-NAME "s" :LONG-NAME "xswitch" :DESCRIPTION ...) #<NULL-LEXENV>)
  2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (NET.DIDIERVERNA.CLON:DEFSYNOPSIS NIL (TEXT :CONTENTS "Some texts") (XSWITCH :SHORT-NAME "s" :LONG-NAME "xswitch" :DESCRIPTION ...)) #<NULL-LEXENV>)
  3: (SB-EXT:EVAL-TLF (NET.DIDIERVERNA.CLON:DEFSYNOPSIS NIL (TEXT :CONTENTS "Some texts") (XSWITCH :SHORT-NAME "s" :LONG-NAME "xswitch" :DESCRIPTION ...)) 4 NIL)
  4: ((LABELS SB-FASL::EVAL-FORM :IN SB-INT:LOAD-AS-SOURCE) (NET.DIDIERVERNA.CLON:DEFSYNOPSIS NIL (TEXT :CONTENTS "Some texts") (XSWITCH :SHORT-NAME "s" :LONG-NAME "xswitch" :DESCRIPTION ...)) 4)
  5: ((LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) (NET.DIDIERVERNA.CLON:DEFSYNOPSIS NIL (TEXT :CONTENTS "Some texts") (XSWITCH :SHORT-NAME "s" :LONG-NAME "xswi..
  6: (SB-C::%DO-FORMS-FROM-INFO #<FUNCTION (LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) {100D4D89FB}> #<SB-C::SOURCE-INFO {100D4D89C3}> SB-C::INPUT-ERROR-IN-LOA..
  7: (SB-INT:LOAD-AS-SOURCE #<SB-INT:FORM-TRACKING-STREAM for "file /home/admich/tmp/prova.lisp" {100D4A7483}> :VERBOSE NIL :PRINT NIL :CONTEXT "loading")
  8: ((FLET SB-FASL::THUNK :IN LOAD))
  9: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<FUNCTION (FLET SB-FASL::THUNK :IN LOAD) {7F9961ADE15B}> #<SB-INT:FORM-TRACKING-STREAM for "file /home/admich/tmp/prova.lisp" {100D4A7483}>)
 10: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #<SB-INT:FORM-TRACKING-STREAM for "file /home/admich/tmp/prova.lisp" {100D4A7483}> NIL)
 11: (LOAD #P"/home/admich/tmp/prova.lisp" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEFAULT)
 --more--

ERROR: System "net.didierverna.clon.termio" not found

Seems, new CLON is broken. I started to receive this error:

System "net.didierverna.clon.termio" not found
   [Condition of type QUICKLISP-CLIENT:SYSTEM-NOT-FOUND]

Restarts:
 0: [CONTINUE] Try again
 1: [ABORT] Give up on "net.didierverna.clon.termio"
 2: [ABORT] Give up on "net.didierverna.clon"
 3: [REGISTER-LOCAL-PROJECTS] Register local projects and try again.
 4: [RETRY] Retry SLY mREPL evaluation request.
 5: [*ABORT] Return to SLY's top level.
 --more--

Backtrace:
 0: ((LABELS QUICKLISP-CLIENT::RECURSE :IN QUICKLISP-CLIENT::COMPUTE-LOAD-STRATEGY) "net.didierverna.clon.termio")
      Locals:
        QL-DIST:NAME = "net.didierverna.clon.termio"
 1: (QL-DIST::CALL-WITH-CONSISTENT-DISTS #<FUNCTION (LAMBDA NIL :IN QUICKLISP-CLIENT::COMPUTE-LOAD-STRATEGY) {10031688CB}>)
      Locals:
        FUN = #<FUNCTION (LAMBDA () :IN QUICKLISP-CLIENT::COMPUTE-LOAD-STRATEGY) {10031688CB}>
 2: (QUICKLISP-CLIENT::COMPUTE-LOAD-STRATEGY "net.didierverna.clon.termio")
      Locals:
        ASDF-SYSTEMS = NIL
        NAME = "net.didierverna.clon.termio"
        QUICKLISP-SYSTEMS = NIL
 3: (QUICKLISP-CLIENT::AUTOLOAD-SYSTEM-AND-DEPENDENCIES "net.didierverna.clon.termio" :PROMPT NIL)
      Locals:
        NAME = "net.didierverna.clon.termio"
        PROMPT = NIL
        TRIED-SO-FAR = #<HASH-TABLE :TEST EQUALP :COUNT 0 {10031687A3}>
 4: (QUICKLISP-CLIENT::AUTOLOAD-SYSTEM-AND-DEPENDENCIES "net.didierverna.clon" :PROMPT NIL)
      Locals:
        NAME = "net.didierverna.clon"
        PROMPT = NIL
        TRIED-SO-FAR = #<HASH-TABLE :TEST EQUALP :COUNT 1 {1001DD0AA3}>
 5: ((:METHOD QL-IMPL-UTIL::%CALL-WITH-QUIET-COMPILATION (T T)) #<unused argument> #<FUNCTION (FLET QUICKLISP-CLIENT::QL :IN QUICKLISP-CLIENT:QUICKLOAD) {1001DD029B}>) [fast-method]
 6: ((:METHOD QL-IMPL-UTIL::%CALL-WITH-QUIET-COMPILATION :AROUND (QL-IMPL:SBCL T)) #<QL-IMPL:SBCL {10023D95F3}> #<FUNCTION (FLET QUICKLISP-CLIENT::QL :IN QUICKLISP-CLIENT:QUICKLOAD) {1001DD029B}>) [fast-m..
 7: ((:METHOD QUICKLISP-CLIENT:QUICKLOAD (T)) :NET.DIDIERVERNA.CLON :PROMPT NIL :SILENT NIL :VERBOSE NIL) [fast-method]
 8: (QL-DIST::CALL-WITH-CONSISTENT-DISTS #<FUNCTION (LAMBDA NIL :IN QUICKLISP-CLIENT:QUICKLOAD) {1001DC8C5B}>)
 9: (SB-INT:SIMPLE-EVAL-IN-LEXENV (QUICKLISP-CLIENT:QUICKLOAD :NET.DIDIERVERNA.CLON) #<NULL-LEXENV>)
10: (EVAL (QUICKLISP-CLIENT:QUICKLOAD :NET.DIDIERVERNA.CLON))

Environment

CL-USER> (cl-info:get-cl-info)
OS:   Darwin 19.6.0
Lisp: SBCL 2.1.2
ASDF: 3.3.4.13
QL:   quicklisp 2021-04-11

CL-USER> (cl-info:get-system-info :net.didierverna.clon)
System: NET.DIDIERVERNA.CLON NIL
        /private/tmp/test-clon/.qlot/dists/quicklisp/software/clon-1.0b25/

Print usage on error

The clon-error-handler has only a limited set of options, none of which print the help output when an error occurs. I also found it hard to implement that, handler-case doesn't work because errors are caught before I get a chance to handle them, patching the error handler or exit-abnormally are also not possible since the context isn't fully constructed yet when it's still parsing the command line options.

So, is there any way to run help when the supplied command line options were invalid for any reason?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.