Refactor parsing to not require --remote to be first

Use cobra.Command.FParseErrWhitelist to no longer require --remote to be
the first argument in flags when using CLI

Signed-off-by: Jhon Honce <jhonce@redhat.com>
This commit is contained in:
Jhon Honce
2020-08-03 15:41:25 -07:00
parent d1aaf33622
commit 98da2fa806
2 changed files with 18 additions and 12 deletions

View File

@ -207,6 +207,10 @@ func WaitContainerReady(p PodmanTestCommon, id string, expStr string, timeout in
// OutputToString formats session output to string
func (s *PodmanSession) OutputToString() string {
if s == nil || s.Out == nil || s.Out.Contents() == nil {
return ""
}
fields := strings.Fields(string(s.Out.Contents()))
return strings.Join(fields, " ")
}