We have these lines repeated in many places
tlsFiles, err := c.Flags().GetString(common.TLSFiles)
cobra.CheckErr(err)
addr, err := c.Flags().GetString(common.AddrCmdLineArg)
cobra.CheckErr(err)
We can consider if we can remove that duplication by:
- search in cobra if they already have a dedicated mechanism to solve such issue.
- extract into a separate func
- fetch into global vars and reuse them in cobra commands