Conversation
refactor and simplify argument parsing
yadvr
left a comment
There was a problem hiding this comment.
Didn't test it, but LGTM - should merge this after testing
There was a problem hiding this comment.
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
commandvariable and usesshiftto 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.
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 "$@" | |
| ;; | ||
| deploy) | ||
| deploy "$@" | ||
| # ${@:2} |
There was a problem hiding this comment.
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 "$@" | |
| ;; | ||
| ssh) | ||
| issh "root@$1" | ||
| # root@$2 |
There was a problem hiding this comment.
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" |
| ;; | ||
| ssh) | ||
| issh "root@$1" | ||
| # root@$2 |
There was a problem hiding this comment.
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" |
| ;; | ||
| ssh) | ||
| issh "root@$1" | ||
| # root@$2 |
There was a problem hiding this comment.
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 |
refactor and simplify argument parsing