Skip to content

tests: skip argv[0] in run-parser input processing - #348

Open
1234binpig wants to merge 1 commit into
yaml:masterfrom
1234binpig:fix-run-parser-argv-start
Open

1234binpig wants to merge 1 commit into
yaml:masterfrom
1234binpig:fix-run-parser-argv-start

Conversation

@1234binpig

Copy link
Copy Markdown

Problem

run-parser starts processing input arguments at argv[0], so when no options are used it attempts to parse its own executable before the requested YAML files.

Fix

Initialize the first input index to 1, so only user-supplied arguments are processed as YAML input files.

Testing

Verified that:

  • the original code attempts to parse the run-parser executable;
  • the updated code processes only the supplied YAML file;
  • the normal parser test behavior remains unchanged.

run-parser initialized the first input index to 0, causing argv[0]
(the executable itself) to be treated as a YAML input file when no
options were provided.

Start processing input files at argv[1] instead.

Signed-off-by: huangwenbin <huangwenbin@kylinos.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant