function createFilter(pattern) {
    const trimmed = pattern.trim()
    const spacePos = trimmed.indexOf(" ")
    const task = spacePos < 0 ? trimmed : trimmed.slice(0, spacePos)
    const args = spacePos < 0 ? "" : trimmed.slice(spacePos)
    const matcher = new Minimatch(swapColonAndSlash(task), { nonegate: true })
    const match = matcher.match.bind(matcher)

    return { match, task, args }
}
Creates a filter from user-specified pattern text.

The task name is the part until the first space.
The rest part is the arguments for this task.

@param {string} pattern - A pattern to create filter.
@returns {{match: function, task: string, args: string}} The filter object of the pattern.