Nikita Karetnikov <[email protected]> skribis:

>> It actually does, but it has no side effect.
>
> I know that printing is a side effect.  Why do you recommend to use
> 'alist-cons'?  If it's not possible to display anything, then
> 'roll-back' won't be able to print the following messages.

It’s just the /option handler/ (the procedure passed to SRFI-37
‘option’) that should not print anything.  It is then OK to print
things, of course, like is done for other options.

Check how the other options are handled: during ‘args-fold’, the option
handler just adds to RESULT an element saying that this option was
passed.  Once ‘args-fold’ has completed, we check its result: if it
contains a pair whose key is ‘install’, then it means we want to install
something, and so on.

>> When ‘--profile’ is passed, the result of ‘parse-options’ contains a
>> pair whose key is ‘profile’.  The (assoc-ref opts 'profile) calls that
>> you see retrieve the argument given to ‘--profile’.
>
> It's clear.  But where should I call (assoc-ref opts 'profile)?  Should
> I do it in 'process-query'?

In ‘process-actions’ more precisely, because roll-back is an action, not
a query.  And ‘process-actions’ already does that.

HTH,
Ludo’.

Reply via email to