guix-patches
[Top][All Lists]
Advanced

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

[bug#40373] [PATCH] guix: new command "guix run-script"


From: zimoun
Subject: [bug#40373] [PATCH] guix: new command "guix run-script"
Date: Thu, 23 Apr 2020 16:41:03 +0200

Hi Konrad,

On Thu, 23 Apr 2020 at 12:13, Konrad Hinsen <address@hidden> wrote:

> > Why not simply add an option to "guix repl"?
> > For example "--batch", mimicking  "emacs --batch".
> > Or "--script".
>
> Do you have a suggestion for explaining such a command to someone who
> want to run a script bu (1) doesn't know what a REPL is, (2) doesn't
> need to know what a REPL is, (3) would be mystified by the behavior
> resulting from forgetting the –script argument?

If I understand well
     guix run-script file1 file2
is becoming:
    guix repl --script=file1,file2,...
right?

Well, I would say that

--8<---------------cut here---------------start------------->8---
the keyword "repl" stand for Read-Eval-Print-Loop
therefore the command will:
  - read the script file1,
  - eval it,
  - print the results if they are,
  - and finally loop if there is more than one script file.
--8<---------------cut here---------------end--------------->8---

this fills the condition (1) and (2); at least to me. ;-)


I agree that forgetting the argument '--script' could mystified the learner.

But applying the same principles, the command
    guix environment --ad-hoc python -- python
could mystified the learner too, if for example they forgets --ad-hoc
or '-- python'.

Well, this kind of disconcerting "mistakes" is part of the learning
process, IMHO.
Others call that "discoverability". ;-)


> I agree of course that naming is hard, but it is also important.  Git
> should be a sufficient demonstration of what happens when you design
> command-line interfaces by a sequence of cumulative least-effort
> decisions.

I agree.
And I still have in my stack how to propose another CLI naming as we
discussed earlier, e.g.,
    environment, package, etc.
reorganized into
  profile, install, search, etc.


Cheers,
sion





reply via email to

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