The output of 'show interface' can be very long so use of a pager seems appropriate. Unfortunately, this requires changes across many routines inherited from ifconfig which were hard-coded to write to stdout. This commit changes such prints to write to a temporary file instead, and hopefully I caught them all.
For now, error messages still go to standard output. In some cases the propagation of error return codes is inconsistent and won't allow callers to know whether an error occurred. This should be fixed first. I did consider writing all errors to the temporary file as part of regular output but I am undecided whether this is the best approach. If nsh ever becomes a multi-process program we will likely want errors to appear on a dedicated channel.
The output of 'show interface' can be very long so use of a pager seems appropriate. Unfortunately, this requires changes across many routines inherited from ifconfig which were hard-coded to write to stdout. This commit changes such prints to write to a temporary file instead, and hopefully I caught them all.
For now, error messages still go to standard output. In some cases the propagation of error return codes is inconsistent and won't allow callers to know whether an error occurred. This should be fixed first. I did consider writing all errors to the temporary file as part of regular output but I am undecided whether this is the best approach. If nsh ever becomes a multi-process program we will likely want errors to appear on a dedicated channel.