crunchmail / munch-core

Munch is an emailing platform.
https://crunchmail.github.io/munch-core/
GNU Affero General Public License v3.0
5 stars 3 forks source link

More complex worker-type parameter #1

Open toxinu opened 7 years ago

toxinu commented 7 years ago

Allow this syntax munch run worker --worker-type gc mx.

Doc: http://click.pocoo.org/5/options/#multi-value-options

n11c commented 7 years ago

Looks like multi-value options in Click only work with fixed number of values. That's limiting.

A better syntax might be: munch run worker --worker-type gc,mx

toxinu commented 7 years ago

Click handle multiple options like that: -t core -t gc [...].

I'll add a shorter parameter for --worker-type, like -t.

munch run worker --help
Usage: munch run worker [OPTIONS]

  Run background worker instance.

Options:
  -t, --worker-type [all|core|status|router|mx|gc]
        Define which kind of task worker will consume.  [default: all]

Is it ok for you?

n11c commented 7 years ago

Looks good. (Obviously "-t all" needs to be mutually exclusive with others. )