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

Documentation of "Key" optional Keyword #84

Open
itdependsnetworks opened this issue May 31, 2020 · 2 comments
Open

Documentation of "Key" optional Keyword #84

itdependsnetworks opened this issue May 31, 2020 · 2 comments

Comments

@itdependsnetworks
Copy link

The word Key is getting overloaded here, but per my understanding of the documentation, the title is correct. There are Keywords (value, filldown, etc) and one of them is "Key". In the wiki it states:

"Key Declares that the fields contents contribute to the unique identifier for a row."

The one test that include "Key" shows a syntax in clitable also not documented in the "CLI Table" Wiki as well. Does this only work if using multiple templates as in that one test?

Anyway to get a quick explanation of how to use this?

@harro
Copy link
Contributor

harro commented May 27, 2021

True the documentation is not sufficient in this area. Partly because it is primarily of used by downstream tooling although it could be used directly here for those interested.

The function is described in the source code
https://github.com/google/textfsm/blob/master/textfsm/clitable.py#L168

And influences the Name Value Pair display format, which is documented briefly in TCLI https://github.com/google/tcli/wiki/TCLI-Power-Users-Guide#name-value-pairs-nvp ... note how columns are treated differently based on which ones are part of the key, or not.
i.e. it determines which values are on the left vs right hand side of the NVP record displayed.

@harro
Copy link
Contributor

harro commented May 27, 2021

I think perhaps the TCLI documentation needs expanding and a link between the two added here in TextFSM.

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

2 participants