-
Notifications
You must be signed in to change notification settings - Fork 9
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
base: main
Are you sure you want to change the base?
Conversation
refactor and simplify argument parsing
There was a problem hiding this 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
There was a problem hiding this 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 usesshift
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
;; | ||
deploy) | ||
deploy "$@" | ||
# ${@:2} |
There was a problem hiding this comment.
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.
# ${@:2} | |
;; | |
deploy) | |
deploy "$@" | |
Copilot uses AI. Check for mistakes.
;; | ||
deploy) | ||
deploy "$@" | ||
# ${@:2} |
There was a problem hiding this comment.
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.
# ${@:2} | |
;; | |
deploy) | |
deploy "$@" | |
Copilot uses AI. Check for mistakes.
;; | ||
ssh) | ||
issh "root@$1" | ||
# root@$2 |
There was a problem hiding this comment.
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.
# root@$2 | |
;; | |
agentscp) | |
agentscp "$@" | |
;; | |
ssh) | |
issh "root@$1" |
Copilot uses AI. Check for mistakes.
;; | ||
ssh) | ||
issh "root@$1" | ||
# root@$2 |
There was a problem hiding this comment.
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.
# root@$2 | |
;; | |
agentscp) | |
agentscp "$@" | |
;; | |
ssh) | |
issh "root@$1" |
Copilot uses AI. Check for mistakes.
;; | ||
ssh) | ||
issh "root@$1" | ||
# root@$2 |
There was a problem hiding this comment.
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.
# root@$2 |
Copilot uses AI. Check for mistakes.
refactor and simplify argument parsing