mbox

[bug#35456,0/1] Add 'guix install', 'guix remove', and 'guix upgrade'

Message ID 20190427162500.13554-1-ludo@gnu.org
Headers show

Message

Ludovic Courtès April 27, 2019, 4:25 p.m. UTC
Hello Guix!

Here’s a change that’s both trivial and anecdotal by its size and
complexity, and super important after 7 years typing ‘guix package -i’
when every other tool out there has an ‘install’ sub-command.  :-)

The main question is how we are going to present it when we introduce
people to Guix.  In the manual I listed the aliases and changed
several instances of ‘guix package -i’ to ‘guix install’.  To me,
‘guix package’ remains unavoidable, but having ‘guix install’ in
particular is important to help newcomers get started quickly.

Technically, the aliases are not dumb: you cannot do, say,
‘guix install -r foo’ to remove a package.  There’s little code
duplication beyond ‘show-help’ and the license header.

Thoughts?  Rejection?  Happiness?  :-)

Thanks,
Ludo’.

Ludovic Courtès (1):
  guix package: Add 'install', 'remove', and 'upgrade' aliases.

 Makefile.am                   |  4 ++
 doc/guix.texi                 | 39 ++++++++++-----
 guix/scripts/install.scm      | 81 +++++++++++++++++++++++++++++++
 guix/scripts/package.scm      | 11 ++++-
 guix/scripts/remove.scm       | 78 ++++++++++++++++++++++++++++++
 guix/scripts/upgrade.scm      | 90 +++++++++++++++++++++++++++++++++++
 po/guix/POTFILES.in           |  3 ++
 tests/guix-package-aliases.sh | 58 ++++++++++++++++++++++
 8 files changed, 352 insertions(+), 12 deletions(-)
 create mode 100644 guix/scripts/install.scm
 create mode 100644 guix/scripts/remove.scm
 create mode 100644 guix/scripts/upgrade.scm
 create mode 100644 tests/guix-package-aliases.sh

Comments

Jonathan Brielmaier April 28, 2019, 11:26 a.m. UTC | #1
On 4/27/19 6:25 PM, Ludovic Courtès wrote:
> Thoughts?  Rejection?  Happiness?  :-)

I think we shouldn't do this for the 1.0 release. We should take some
time here. One reason is that it's quite some work to get this
documented and then translated...

The idea of offering new commands for often used ones, is very good.
Personally I would also like to have 'guix search' and 'guix show', as I
use them quite often :)

What I like about the guix command line interface, is the consistency
and logic. Especially if I compare it with some random (open)SUSE tool
like zypper, which has a almost 50 subcommands ("zypper SUBCOMMAND").
That's something we shouldn't imitate.

I feel that grouping commands in subcommands and subsubcommands like
with 'guix system' is a good idea. At the moment I see there some room
for improvement.

We have a lot of developer commands directly under 'guix', like
download, link etc. But the most "end-user" commands are under 'guix
package' or 'guix system'...

For 'guix system' it could make sense to move 'guix system
{container,vm-image,disk,docker-image}' to something like 'guix create'.

Just my five cents :)
Jonathan
Ludovic Courtès April 28, 2019, 1:26 p.m. UTC | #2
Hi Jonathan,

Jonathan Brielmaier <jonathan.brielmaier@web.de> skribis:

> On 4/27/19 6:25 PM, Ludovic Courtès wrote:
>> Thoughts?  Rejection?  Happiness?  :-)
>
> I think we shouldn't do this for the 1.0 release. We should take some
> time here. One reason is that it's quite some work to get this
> documented and then translated...

The patch provides documentation that boils down to ~10 lines since
these are just aliases.  (Also, I think it’s reasonable to say we took
our time: it had been in ‘1.0.org’ since July 2018 and we’ve been
discussing it for years before that.  :-))

> The idea of offering new commands for often used ones, is very good.
> Personally I would also like to have 'guix search' and 'guix show', as I
> use them quite often :)

Yeah, why not.

> What I like about the guix command line interface, is the consistency
> and logic. Especially if I compare it with some random (open)SUSE tool
> like zypper, which has a almost 50 subcommands ("zypper SUBCOMMAND").
> That's something we shouldn't imitate.
>
> I feel that grouping commands in subcommands and subsubcommands like
> with 'guix system' is a good idea. At the moment I see there some room
> for improvement.
>
> We have a lot of developer commands directly under 'guix', like
> download, link etc. But the most "end-user" commands are under 'guix
> package' or 'guix system'...
>
> For 'guix system' it could make sense to move 'guix system
> {container,vm-image,disk,docker-image}' to something like 'guix create'.

I agree the CLI structure could be improved in several areas.  In fact,
there have been radical proposals in the past to overhaul the whole CLI.

I think “guix install” & co. require special attention though: people
have come to expect install/remove/upgrade sub-commands from their
package manager and these are the first commands they’ll run.  It costs
us very little in terms of maintenance, but it certainly helps newcomers
get started.

Does that make sense?

Thanks for your feedback!

Ludo’.
Jonathan Brielmaier April 29, 2019, 7:42 a.m. UTC | #3
> I agree the CLI structure could be improved in several areas.  In fact,
> there have been radical proposals in the past to overhaul the whole CLI.
> 
> I think “guix install” & co. require special attention though: people
> have come to expect install/remove/upgrade sub-commands from their
> package manager and these are the first commands they’ll run.  It costs
> us very little in terms of maintenance, but it certainly helps newcomers
> get started.
> 
> Does that make sense?

If you are so confident, go ahead and make me happy by adding at least
'guix search' :)
Simon Tournier April 29, 2019, 1:31 p.m. UTC | #4
Dear,

What about user-defined aliases ?
Instead of scattered hard-coded aliases.
Something using a .guixconfig file mimicking .gitconfig.

The default command would be the one we already use.
Predefined aliases such that `guix install` or `guix search` etc.
should live in .guix-profile/etc/guixconfig.
And maybe predefined apt flavor or yum flavour.

I mean something like:

~/.guixconfig

(alias 'ins (package --install))
(flavour 'apt)


~/.guix-profile/etc/guixalias-apt

(alias 'install blabla
         'search blabla
         'show blabla)

~/.guix-profile/etc/guixalias-yum

(alias 'install blabla
         'search blabla
         'info blabla)


I do not know if it makes senses.


All the best,
simon
Ludovic Courtès April 29, 2019, 5:10 p.m. UTC | #5
Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> What about user-defined aliases ?

I agree it’d be useful, it’s a perfectly valid wishlist item IMO!

I think that install/remove/upgrade/search need to be available by
default though, as discussed earlier.

Thanks for your feedback,
Ludo’.