[Mailman-Developers] [GSoC 2014] Mailman CLI Project

Rajeev S rajeevs1992 at gmail.com
Sat May 17 19:21:55 CEST 2014


On Tuesday 13 May 2014 07:12 PM, Barry Warsaw wrote:
> On May 13, 2014, at 03:27 PM, Rajeev S wrote:
>
> Would --list be implied by seeing a `--listname=list at example.com`?  E.g. would
> this be just as useful, and a little shorter:
>
> mmclient show --listname=list at example.com --domain=example.org
>
> ?

In the command *mmclient <scope> <action>* , the scope denotes
the class name and the action denotes the class method to be invoked.

The following format suggested by you,

mmclient show --listname=list at example.com --domain=example.org

 From the developer point of view, its difficult to map an action to a 
class
by using this format. For eg, the above command can be associated
with the class domain or list, as the order of the arguments is 
insignificant.

Further, the commands do not offer much advantage to the user in terms
of usability. Most of the current (frequent) commands are quite 
straightforward
and similar to the ones to be used in the shell, for eg, *create list 
list at domain.org*
compared to *create --listname="list at domain.org"*.

Some commands like *add-role* are less intuitive in this format,yet provide
a tolerable level of understandability.

>> which makes the outcome dependent on the order in which the
>> if-else's are written. This is a serious bug when actions like `delete`
>> are being used.
> Destructive actions should probably be more constrained in what they allow, so
> that there's no possibility of ambiguity on either the part of the user or the
> code.  "In the face of ambiguity, refuse the temptation to guess."
>
>> Got a bit confused with the use of *scope* in this context.
>> Anyways, if the scope is not specified, apply the setting on a
>> default *scope*, `default=site-wide` makes sense, while others
>> do not.
> Hmm.  If scope is optional (because it has a default), then it's not a
> required positional argument, right?  So shouldn't a --switch should be used?


A switch would work best when the number of possible choices are
very few. Here we have the following choices for the scope, site-wide, 
domain
and list. It seems OK to use a switch here.

However, using switches limits the extendibility of the scopes. If a new 
scope
is to be added some day (something server-wide?), integrating new 
switches is not an easy task, when
compared to the addition of a new choice for scope in current approach.

>> And as the final word, I am ready to change the command style,
>>
>> mmclient <action> <scope> <arguments>
>>
>> if there is some serious disagreement with it.
> I just want it to be consistent, easily described, and easily understood by
> users.  If it makes sense for the mmclient CLI to different from the
> shell-access mailman command, then we at least need to be "translatable"
> between the two.

The current format of commands,mmclient <scope> <action> <arguments> is
directly translatable to the shell. In fact, they are almost similar, 
except for the `--`
in the commands.



More information about the Mailman-Developers mailing list