dnaeon / clingon

Command-line options parser system for Common Lisp
Other
122 stars 7 forks source link

Desactivating quit/exit at the REPL if desired #15

Open jf7t2gd1n opened 1 year ago

jf7t2gd1n commented 1 year ago

Thanks for your interesting system.

When working at the REPL I would like sometimes to call clingon:run but desactivating exit (so I continue to be at the REPL) if desired. I did not find the way to do it experimenting with the features of clingon.

If that option is not present and you think it makes sense, could it be added?

Thanks. Best regards.

dnaeon commented 1 year ago

Hey @jf7t2gd1n ,

That feature has been implemented like a couple of months ago.

See https://github.com/dnaeon/clingon/issues/12 for more details.

What version of clingon are you running?

jf7t2gd1n commented 1 year ago

Thanks for your response.

I am using version 0.5.0 .

In /src/utils.lisp, it seems it checks for Sly or Slime.

I am using the REPL and the command line (not through Sly or Slime).

dnaeon commented 1 year ago

Yep, currently it only works for Slime or Sly, as that's usually the way people interact with the REPL :)

Out of curiosity why do you use REPL from the command line instead of Sly/Slime?

jf7t2gd1n commented 1 year ago

I use quite a lot the terminal, and sometimes I do not get to launch emacs.

dnaeon commented 1 year ago

Currently the QUIT function works only for Sly/Slime by looking up the existing *FEATURES*. I'd be happy to review a PR, if you have something in mind.

Thanks!

jf7t2gd1n commented 1 year ago

Thanks for asking. I am not an expert to propose the best way to do it.

For me, I think it would suffice something like a global variable that could be set to desactivate quit/exit when launching clingon:run . Or perhaps an optional or a key argument could be added to clingon:run to address that ??

vindarel commented 12 months ago

Hi, you could probably cheat and add the :swank symbol to the features list (even if swank is not loaded):

(defun main ()
  (let ((*features* (push :swank *features*)))
    (clingon:run my-app)))

or simply

(setf *features* (push :swank *features*))
jf7t2gd1n commented 12 months ago

Yes, thanks.