[PATCH v2 06/10] cli: Introduce "notmuch address" command

Tomi Ollila tomi.ollila at iki.fi
Tue Nov 4 01:40:04 PST 2014


On Tue, Nov 04 2014, David Bremner <david at tethera.net> wrote:

> Michal Sojka <sojkam1 at fel.cvut.cz> writes:
>
>> +{
>> +    local cur prev words cword split
>> +    _init_completion -s || return
>> +
>> +    $split &&
>> +    case "${prev}" in
>> +	--format)
>> +	    COMPREPLY=( $( compgen -W "json sexp text text0" -- "${cur}" ) )
>> +	    return
>> +	    ;;
>> +	--output)
>> +	    COMPREPLY=( $( compgen -W "sender recipients" -- "${cur}" ) )
>> +	    return
>> +	    ;;
>> +	--sort)
>> +	    COMPREPLY=( $( compgen -W "newest-first oldest-first" -- "${cur}" ) )
>> +	    return
>> +	    ;;
>> +	--exclude)
>> +	    COMPREPLY=( $( compgen -W "true false flag all" -- "${cur}" ) )
>> +	    return
>> +	    ;;
>> +    esac
>> +
>> +    ! $split &&
>> +    case "${cur}" in
>> +	-*)
>> +	    local options="--format= --output= --sort= --exclude="
>> +	    compopt -o nospace
>> +	    COMPREPLY=( $(compgen -W "$options" -- ${cur}) )
>> +	    ;;
>> +	*)
>> +	    _notmuch_search_terms
>> +	    ;;
>> +    esac
>> +}
>> +
>
> I am reminded that we have no tests for shell completion stuff, which
> seems pretty fragile.

That is what users are for -- i.e. the completion testing monkies ! ;D
>
>> +
>> +    ``--format=``\ (**json**\ \|\ **sexp**\ \|\ **text**\ \|\ **text0**)
>> +        Presents the results in either JSON, S-Expressions, newline
>> +        character separated plain-text (default), or null character
>> +        separated plain-text (compatible with **xargs(1)** -0 option
>> +        where available).
>> +
>> +    ``--format-version=N``
>> +        Use the specified structured output format version. This is
>> +        intended for programs that invoke **notmuch(1)** internally. If
>> +        omitted, the latest supported version will be used.
>> +
>
>
> I wonder if at some point we should have a notmuch-output-formats.7 page.
>
>
>> +    ``--exclude=(true|false|all|flag)``
>> +        A message is called "excluded" if it matches at least one tag in
>> +        search.tag\_exclude that does not appear explicitly in the
>> +        search terms. This option specifies whether to omit excluded
>> +        messages in the search process.
>
> Similarly for excludes.  I'm ok with the duplication for now, and I can
> see an argument for not making the user chase references.
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list