mirror of
https://github.com/slackhq/nebula.git
synced 2025-12-30 18:48:28 +01:00
Fix 756 SSH command line parsing error to write to user instead of stderr (#757)
This commit is contained in:
@@ -40,8 +40,13 @@ func execCommand(c *Command, args []string, w StringWriter) error {
|
|||||||
if c.Flags != nil {
|
if c.Flags != nil {
|
||||||
fl, fs = c.Flags()
|
fl, fs = c.Flags()
|
||||||
if fl != nil {
|
if fl != nil {
|
||||||
//TODO: handle the error
|
// SetOutput() here in case fl.Parse dumps usage.
|
||||||
fl.Parse(args)
|
fl.SetOutput(w.GetWriter())
|
||||||
|
err := fl.Parse(args)
|
||||||
|
if err != nil {
|
||||||
|
// fl.Parse has dumped error information to the user via the w writer.
|
||||||
|
return err
|
||||||
|
}
|
||||||
args = fl.Args()
|
args = fl.Args()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user