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

Add helper functions for printing flags #12094

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Beautified
Signed-off-by: cs-308-2023 <[email protected]>
ADI-ROXX committed Jan 19, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit dd7626a0ee86bd5f8d72c576ba88c0264c261a24
23 changes: 6 additions & 17 deletions otelcol/flags.go
Original file line number Diff line number Diff line change
@@ -64,33 +64,22 @@ func featureflags(reg *featuregate.Registry) {
if f.reg == nil {
return
}
c := 1

f.reg.VisitAll(func(g *featuregate.Gate) {
str := ""
id := g.ID()
desc := g.Description()
if !g.IsEnabled() {
id = "-" + id
}
str += fmt.Sprint(c) + "." + id + "\n"
str += id + "\n"
str+= "Description: "+desc + "\n"
ref := g.ReferenceURL()
from := g.FromVersion()
to := g.ToVersion()
if(ref != ""){
str+= "ReferenceURL: "+ref + "\n"
}
if(from != "v<nil>"){
str+= "From version: "+from + "\n"

}
if(to != "v<nil>"){
str+= "From version: "+to + "\n"

if !g.IsEnabled() {
str+= "Default state: " + "On"
} else{
str+= "Default state: " + "Off"
}
// str += "\n"
c+=1
str += "\n"
fmt.Println(str)
})
}