DietPi-Globals | Tuning processing messages #1365
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Just copying the method of other installation scripts lead to a complicated solution. "\r" is the command to move "cursor" position to beginning of line, thus just adding "\r" at the end of every processing message (leading -n also necessary) does the job.
Now every processing message will be overwritten by any other kind of output. In best cases it should be some ok or error from error handler, but if there are some other command outputs in between this is also okay and shows user what is going on/that something is going on.
If there is information we want users to keep/review, then use
G_DIETPI-NOTIFY 2 ...
for [Info].Btw: Don't we want preparation script to use
G_DIETPI-NOTIFY 3 ...
for the installation step info? At the moment it uses info messages, thus leading [Info] string appears at the beginning of header+separation lines 😆.