Skip to content

refactor argument parsing #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

oferchen
Copy link
Contributor

refactor and simplify argument parsing

refactor and simplify argument parsing
Copy link
Member

@rohityadavcloud rohityadavcloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't test it, but LGTM - should merge this after testing

@shwstppr shwstppr requested a review from Copilot August 11, 2025 05:52
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the argument parsing logic in the mbx script to improve code organization and readability. The refactoring extracts the command argument into a variable and uses shift to process remaining arguments, while also updating how arguments are passed to functions.

  • Extracts the first argument into a command variable and uses shift to handle remaining arguments
  • Updates function calls to use "$@" instead of ${@:2} for better argument handling
  • Improves code formatting with consistent indentation and line breaks

mbx
;;
deploy)
deploy "$@"
# ${@:2}
Copy link
Preview

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the commented out code # ${@:2} as it's no longer needed after the refactoring. Dead code should be cleaned up to improve maintainability.

Suggested change
# ${@:2}
;;
deploy)
deploy "$@"

Copilot uses AI. Check for mistakes.

mbx
;;
deploy)
deploy "$@"
# ${@:2}
Copy link
Preview

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the commented out code # ${@:2} as it's no longer needed after the refactoring. Dead code should be cleaned up to improve maintainability.

Suggested change
# ${@:2}
;;
deploy)
deploy "$@"

Copilot uses AI. Check for mistakes.

mbx
;;
ssh)
issh "root@$1"
# root@$2
Copy link
Preview

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the commented out code # ${@:2} as it's no longer needed after the refactoring. Dead code should be cleaned up to improve maintainability.

Suggested change
# root@$2
;;
agentscp)
agentscp "$@"
;;
ssh)
issh "root@$1"

Copilot uses AI. Check for mistakes.

mbx
;;
ssh)
issh "root@$1"
# root@$2
Copy link
Preview

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the commented out code # ${@:2} as it's no longer needed after the refactoring. Dead code should be cleaned up to improve maintainability.

Suggested change
# root@$2
;;
agentscp)
agentscp "$@"
;;
ssh)
issh "root@$1"

Copilot uses AI. Check for mistakes.

mbx
;;
ssh)
issh "root@$1"
# root@$2
Copy link
Preview

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the commented out code # root@$2 as it's no longer needed after the refactoring. Dead code should be cleaned up to improve maintainability.

Suggested change
# root@$2

Copilot uses AI. Check for mistakes.

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.

2 participants