Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

add better documentation to --filter #414

@georgettica

Description

@georgettica

related to

filter: F.string({description: 'filter property by partial string matching, ex: name=foo'}),

after reading

if (this.options.filter) {
/* eslint-disable-next-line prefer-const */
let [header, regex] = this.options.filter!.split('=')
const isNot = header[0] === '-'
if (isNot) header = header.substr(1)
const col = this.findColumnFromHeader(header)
if (!col || !regex) throw new Error('Filter flag has an invalid value')
rows = rows.filter((d: any) => {
const re = new RegExp(regex)
const val = d[col!.key]
const match = val.match(re)
return isNot ? !match : match
})
}

I was able to deduce the != doesn't exist in the query language and a prepended - will do the trick

this could have been subverted if the help message would direct me to documentation on how the filter query language works

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions