Closed JanLukasGithub closed 2 years ago
This needs rebasing
@JanLukasGithub Thanks! I'm OK to merge this as it is.
Unfortunately, CommandWithoutConfig needs to access rootCmd in some way, and because two packages can't import each other, this is the best I could come up with
Another option maybe to change the signature of NewRuntime
from
func NewRuntime(conf Config, accountName string, commandWithoutConfig bool) (*Runtime, error)
to something like
func NewRuntime(account *AccountEntry) (*Runtime, error)
Because, that runtime thing only ever works on one single account entry (or none at all, in which case entry would be nil) and does not necessarily need all the other accounts. If it would need those it could look like
func NewRuntime(conf Config, account *AccountEntry) (*Runtime, error)
Uses rootCmd.Find(os.Args[1:]). Fixes #147