Fix 3084: Correct flag optional value behavior and add comprehensive tests
Fix 3084: Correct flag optional value behavior and add comprehensive tests: a task in repo2rlenv-commit-runtime-v2 (Harbor dataset). Title: Options with is flag=False, flag value=... raise "requires an argument" error instead of using flag value
Part of FineEnvs/repo2rlenv-commit-runtime.