scripts: refactored scripts located under target/bin/#2500
scripts: refactored scripts located under target/bin/#2500georglauterbach merged 15 commits intomasterfrom
target/bin/#2500Conversation
The scripts under `target/bin/` now use the new log and I replaced some `""` with `''` on the way. The functionality stays the same, this mostly style and log.
Moreover, a few messages for BATS were streamlined and a regression in the linting script reverted.
This comment was marked as resolved.
This comment was marked as resolved.
The new output has a single, clear message with the '[ ERROR ] ' prefix, and then output that explains the error afterwards. This is coherent with the logging style which should be used while providing more information than just a single line about IPTables not functioning.
Before, scripts located under `target/bin/` were using `usage` or `__usage`. Now, they're using `__usage` as they should.
|
It seems I was (literally less than) 1 minute too late. I noticed that |
With `sedfile`, we cannot use the helper functions in a nice way because it is used early in the Dockerfile at a stage where the helper scripts are not yet copied. The script has been adjusted to be canonical with all the other scripts under `target/bin/`.
|
I have added another commit (4560650) to adjust |
|
🤦🏼 🤦🏼 🤦🏼 Nice test failure (due to not matching substring). @polarathene sorry for updating the PR again. I feel like I'm pestering you, and I promise, I'm not doing it on purpose :) |
`__usage` is to be used on wrong user input, not on other failures as well. This was fixed in `delquota` and `setquota`.
| set -ueo pipefail | ||
|
|
||
| HASHTOOL="sha1sum" | ||
| function __usage { echo "Usage: ${0} -i <replace/delete operation> <file>" ; } |
There was a problem hiding this comment.
Why introducing a function, that is only called once?
There was a problem hiding this comment.
Probably the intention was to just be consistent with other CLI utility scripts in this folder? That's not such a bad thing even if it might be redundant in this particular file 😅
There was a problem hiding this comment.
All the changes are done for uniformity with the other scripts. In #2493 (comment) you pledged for a "continuous look and feel" - this is it (looking at all the other scripts). I have become a bit tired of never-ending small nitpicks like this to be frank. Therefore, I will leave this in (because it really is a nice addition to script uniformity), but I will revert some of the other changes to sedfile - otherwise I fear, these changes might never end up in master...
There was a problem hiding this comment.
you pledged for a "continuous look and feel" - this is it
Fair point. And with that argumentation, I agree with keeping _usage. For the same reason I wonder, why you decline to introduce _log in this PR? Technically it's no problem to copy the needed files before the first usage of sedfile.
Keeping the echos is clearly against a "continuous look and feel".
There was a problem hiding this comment.
If you want to add _log to sedfile do it as a follow-up PR, lets just get this stuff merged while it's in a good state and approved 😅
There was a problem hiding this comment.
I agree with @polarathene :) @casperklein I will add a smaller follow-up PR that introduces _log to sedfile :D
…into scripts/refactoring/target-bin
Description
The scripts under
target/bin/now use the new log and I replaced some""with''on the way. The functionality stays the same, this mostlystyle and log.
Type of change
Checklist:
docs/)