node-triton
node-triton copied to clipboard
`-o field,field,...` should be strict about allowed fields
Currently it just silently fails, e.g.:
$ triton insts -o name,primaryip,package
NAME PRIMARYIP PACKAGE
nagios01 - t4-standard-2G
rsyslog - t4-standard-2G
elk_logstash_1 - t4-standard-1G
because it is primaryIp
, not primaryip
.
Compare to:
[root@headnode (nightly-1) ~]# zfs list -o name,used,foobar
bad property list: invalid property 'foobar'
usage:
list [-Hp] [-r|-d max] [-o property[,...]] [-s property]...
[-S property]... [-t type[,...]] [filesystem|volume|snapshot] ...
The following properties are supported:
PROPERTY EDIT INHERIT VALUES
available NO NO <size>
...
On 2/5/16 12:28 , Trent Mick wrote:
Currently it just silently fails, e.g.:
$ triton insts -o name,primaryip,package NAME PRIMARYIP PACKAGE nagios01 - t4-standard-2G rsyslog - t4-standard-2G elk_logstash_1 - t4-standard-1G
because it is
primaryIp
, notprimaryip
.
Though if this ends up being that common a typo, perhaps we should be doing a case insensitive comparison on property names here in addition to the fatal erroring when passing something like foobar.
Compare to:
[root@headnode (nightly-1) ~]# zfs list -o name,used,foobar bad property list: invalid property 'foobar' usage: list [-Hp] [-r|-d max] [-o property[,...]] [-s property]... [-S property]... [-t type[,...]] [filesystem|volume|snapshot] ... The following properties are supported: PROPERTY EDIT INHERIT VALUES available NO NO <size> ...
I agree with @rmustacc on this. I can't imagine a situation where casing would be the differentiating factor for key names. Case insensitive matching + error on unknown fields would be good here.
It may contribute 'tabula'
https://github.com/trentm/node-tabula/blob/master/lib/tabula.js
how can i contribute this ?
@YangYong3 You could create a pull request against that repo to add a "caseInsensitiveLookup: true" option to node-tabula.