fix(parse_errors command): fix mibs directory specification for parse_errors command #1135
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.
@SuperQ, this PR fixes an issue where the
parse_errors
command was not finding the./mibs
directory, therefore preventing theparse_errors
command from working properly. This fix also adds support for manually specifying the mibs directory via the-m
flag in theparse_errors
command.Context
Previously, the
parse_errors
command was not correctly finding the defaultmibs
directory, nor did it allow the user to manually specify a mibs directory.The
make generate
(orgenerator generate
after building) works by defaulting to the sibling./mibs
directory, butmake parse_errors
(orgenerator parse_errors
) does not. The reason for this, is because the command line parser will interpret an omitted flag as an empty string. So this line, when running thegenerate
command, is evaluating to a length of1
with an empty string, therefore defaulting to theC.netsnmp_get_mib_directory()
. But since this flag wasn't enable for theparse_errors
command, that same line was evaluating to a length of0
, and no default was being returned.