mbox

[bug#38678,0/2] Add '--load-path' to subcommands

Message ID 20191219210958.8807-1-zimon.toutoune@gmail.com
Headers show

Message

Simon Tournier Dec. 19, 2019, 9:09 p.m. UTC
Dear,

Here [1] has been discussed the addition of '--load-path' to the commands that
need it. What come in mind is:

 + guix graph
 + guix size

Done by these 2 patches.


Note that "guix size -L" is not tested because the file "tests/guix-size.sh"
does exist and does the option "--load-path" needs to be tested at the Scheme
level?


Then, what about:

 - guix refresh: -L already means --list-updaters
   Only --load-path? Nothing?

 - guix edit: I am not convinced it is useful because if you apply -L
   path/to/your/modules then it is easy to find the correct file to open.
   What do you think?


Thanks
simon

[1] https://lists.gnu.org/archive/html/guix-devel/2019-12/msg00281.html


zimoun (2):
  graph: Add '--load-path' option.
  size: Add '--load-path' option.

 doc/guix.texi          | 15 +++++++++++++++
 guix/scripts/graph.scm | 10 +++++++++-
 guix/scripts/size.scm  |  8 ++++++++
 tests/guix-graph.sh    | 27 +++++++++++++++++++++++++--
 4 files changed, 57 insertions(+), 3 deletions(-)

Comments

Simon Tournier Jan. 8, 2020, 6:53 p.m. UTC | #1
Dear,

Please find the amended patches about 'graph' and 'size'.

On Thu, 19 Dec 2019 at 22:10, zimoun <zimon.toutoune@gmail.com> wrote:

>  - guix refresh: -L already means --list-updaters
>    Only --load-path? Nothing?

The short option '-L' is dropped of the %standard-build-options.

Note that if I read correctly, nothing of the sucommand 'resfresh' is tested.

>  - guix edit: I am not convinced it is useful because if you apply -L
>    path/to/your/modules then it is easy to find the correct file to open.
>    What do you think?

Even it is easy to find the correct file to open, it adds consistency
with the other subcommands and it can help when using local channels.

Nothing about the subcommand 'edit' is tested neither.



All the best,
simon
Simon Tournier Jan. 8, 2020, 8:59 p.m. UTC | #2
Dear,

Do it make sense to add the option "--load-path" to the subcommand 'repl'?


All the best,
simon
Pierre Neidhardt Jan. 8, 2020, 9:27 p.m. UTC | #3
I'd say yes, even though it has limited benefits.
In `guix repl`, you can see the load path with

--8<---------------cut here---------------start------------->8---
%load-path
--8<---------------cut here---------------end--------------->8---

The --load-path option would essentially be the same as appending the
path to the %load-path variable from the REPL.
Simon Tournier Jan. 9, 2020, 1:19 p.m. UTC | #4
Hi Pierre,

On Wed, 8 Jan 2020 at 22:27, Pierre Neidhardt <mail@ambrevar.xyz> wrote:
>
> I'd say yes, even though it has limited benefits.
> In `guix repl`, you can see the load path with
>
> --8<---------------cut here---------------start------------->8---
> %load-path
> --8<---------------cut here---------------end--------------->8---
>
> The --load-path option would essentially be the same as appending the
> path to the %load-path variable from the REPL.

Agree.

Note that 'guile' has the option too:
" -L DIRECTORY   add DIRECTORY to the front of the module load path"


Well, I send 2 patches about "guix repl":

 1. adding the 'load-path' option;
 2. adding the option '--listen' in the message outputted by '--help'.

Feel free to review and push if everything appear to you correct.


Cheers,
simon