Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca committed Mar 9, 2023
1 parent 260c427 commit 2c90e31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ abstract class Command(

/**
* @brief Initialize command arguments
* @param argc The number of arguments to a command (Does not include command itself)
* @param args Supplied command-line arguments as an array of String objects.
*/
fun initArguments(argc: Int, args: Array<String>) {
fun initArguments(args: Array<String>) {
val argc = args.size
var mandatoryArgsCount = 0
var currentIndex = 0
for (arg in arguments) {
Expand All @@ -222,7 +222,7 @@ abstract class Command(
}

// Initialize optional arguments
// Optional arguments expect a name and a value, so i is increased by 2 on every step.
// Optional arguments expect a name and a value, so it is increased by 2 on every step.
var i = mandatoryArgsCount
while (i < argc) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class CommandManager {
// need skip over binary and command name and only get arguments
val temp = Arrays.copyOfRange(args, 2, args.size)
try {
command.initArguments(temp.size, temp)
command.initArguments(temp)
} catch (e: IllegalArgumentException) {
logger.log(Level.INFO, "Arguments init failed with exception: " + e.message)
showCommand(args[0], command)
Expand Down

0 comments on commit 2c90e31

Please sign in to comment.