Skip to content

refactor: simplify argument parsing and modularize bind option handling - #189

Open
bhagathkrishnacdac wants to merge 1 commit into
omec-project:mainfrom
bhagathkrishnacdac:bess-devbind-refactor-methods
Open

refactor: simplify argument parsing and modularize bind option handling#189
bhagathkrishnacdac wants to merge 1 commit into
omec-project:mainfrom
bhagathkrishnacdac:bess-devbind-refactor-methods

Conversation

@bhagathkrishnacdac

Copy link
Copy Markdown

Description
This PR refactors the command-line argument parser (parse_args) in the DPDK binding utility to improve structure, maintainability, and readability.

Key Changes

  • Modularized Bind Options: Extracted _handle_bind_flag to isolate double-binding checks and unbind flag evaluations from the primary CLI option loop.
  • Modernized Option Matching: Replaced verbose, sequential equality checks (opt == A or opt == B) with standard Python tuple membership tests.
  • Compact Tuple Assignment: Consolidated multi-line state changes (such as status flags and device assignments) into clean, single-line tuple assignments.
  • Deduplicated String Literals: Substituted duplicated help guidelines with a module-level constant (USAGE_INFO).

Signed-off-by: bhagathkrishnacdac <bhagath.krishna@cdac.in>
@bhagathkrishnacdac
bhagathkrishnacdac requested a review from a team August 2, 2026 19:24
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