Closed nrwahl2 closed 3 years ago
That's strange. -vv seems to be working fine for me.
I think the issue is that it's trying to set the verbosity level to "v", which isn't a number and thus gets converted to 0.
Oh. It's fence_kdump. I thought it was the other agents using the library.
Yeah, that might be the issue.
Ah. I see the issue. Shouldnt be hard to fix.
Just use a counter if optarg is NULL: https://github.com/ClusterLabs/fence-agents/blob/master/agents/kdump/fence_kdump.c#L453-L455
I think the second v
is treated as optarg
.
Yep. Coffee didnt get to my brain yet. So I guess if optarg isnt int we'll have to do a for to count the v's.
I've made a PR that should solve the issue. Tell me if it's adecuate, or if there's any edge cases worth adding logic for.
Demo:
I assume this is a quirk of
getopt
and I'm not sure if there's a way to fix it as long asverbose
takes an optional argument. I don't have time to look further into it right now, so I'm just documenting it here.