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

Alphabetize object attributes when displaying them in list view in CLI #142

Open
jathanism opened this issue Aug 9, 2017 · 1 comment
Open

Comments

@jathanism
Copy link
Contributor

The nsot CLI utility does not sort attributes by key. It would be nice if it did.

Incidentally when displaying in "grep-friendly" output using -g/--grep the keys are sorted.

@jathanism jathanism changed the title Alphabetize attributes when displaying them in list view in CLI Alphabetize object attributes when displaying them in list view in CLI Aug 9, 2017
@jathanism
Copy link
Contributor Author

Example:

$ nsot devices list -H foo2-bb02
+------------------------------------------------+
| ID      Hostname (Key)   Attributes            |
+------------------------------------------------+
| 29759   foo2-bb02        vendor=juniper        |
|                          monitor=alerted       |
|                          metro=foo             |
|                          facility=foo2         |
|                          dc=foo2               |
|                          role=bb               |
|                          owner=team-networking |
|                          model=QFX10008        |
|                          hw_type=router        |
+------------------------------------------------+

$ nsot devices list -H foo2-bb02 -g
foo2-bb02 dc=foo2
foo2-bb02 facility=foo2
foo2-bb02 hw_type=router
foo2-bb02 metro=foo
foo2-bb02 model=QFX10008
foo2-bb02 monitor=alerted
foo2-bb02 owner=team-networking
foo2-bb02 role=bb
foo2-bb02 vendor=juniper

In the first view, which is the default view, note that the attributes are not sorted.

In the second view, which is "grep-friendly" view, note that the attributes are sorted.

We want the attributes in the default view to also be sorted.

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

No branches or pull requests

1 participant