Introduce (optional) values for tags #358
jotaen
started this conversation in
Feature ideas & discussions
Replies: 2 comments
-
|
Just wanted to mention that I really like this idea. The decision to use |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Resolved via #181. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I think it would be useful to introduce a syntax for tags to have (optional) values assigned to them. For example:
The rules could be this:
=) plus a value.#ticket. In terms of terminology, I’d suggestticketto be the tag’s name and462to be the tag’s value. “Tag” refers to the entire concept.#tag=VALUE≠#tag=value, whereas#TAG=value=#tag=value.#ticket="462"or#ticket='462'. That would allow values to contain more characters, e.g.#ticket="Foo Bar #.:!"→Foo Bar #.:!, whereas without quotes it’d be#ticket=Foo Bar #.:!→Foo, because the space character terminates the tag.#ticket='It\'s done'.#ticketor#ticket=or#ticket="") is treated as empty string. That way, tags without values behave exactly as they do right now.=can only appear once, so#ticket=1=2is either invalid or treated as#ticket=1.On the CLI, users could additionally query for tag values. So with the example above:
klog total --tag ticketwould return4hklog total --tag ticket=462would return4hklog total --tag ticket=1would return0hAnd
klog tagscould additionally break it down by value as well:Discussion
=would be a colon, so#ticket:462. I think the meaning is a bit clearer with an equals sign, however, and it would also avoid ambiguity with a colon that appears within the sentence, likeWorked on a #ticket: it’s not done yet, though.Therefore, I think the=is the better option.#"foo.bar". That looks awkward to me, however, and you could as well use a value then, e.g.#whatever="foo.bar", so I wouldn’t do it.This is a breaking change, because the
=currently terminates the tag. The meaning would change now.Beta Was this translation helpful? Give feedback.
All reactions