Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-o field,field,... should be strict about allowed fields #89

Open
trentm opened this issue Feb 5, 2016 · 4 comments
Open

-o field,field,... should be strict about allowed fields #89

trentm opened this issue Feb 5, 2016 · 4 comments

Comments

@trentm
Copy link
Contributor

trentm commented Feb 5, 2016

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>
...
@rmustacc
Copy link

rmustacc commented Feb 5, 2016

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, not primaryip.

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>
...

@bahamas10
Copy link
Contributor

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.

@YangYong3
Copy link
Contributor

It may contribute 'tabula'
https://github.com/trentm/node-tabula/blob/master/lib/tabula.js

how can i contribute this ?

@trentm
Copy link
Contributor Author

trentm commented Mar 7, 2017

@YangYong3 You could create a pull request against that repo to add a "caseInsensitiveLookup: true" option to node-tabula.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants