컴퓨터
[ Autoit / CmdLine ] 커맨드라인을 입력받아 처리하는 함수의 일부입니다.
Zasfe
2008. 9. 4. 13:31
Func _ParseCmdLine()
Local $intCmdTotal = _GetThisArg(0)
Local $intCmdNum = 1
Local $strCmdCode
While $intCmdNum <= $intCmdTotal
$strCmdCode = _GetThisArg($intCmdNum)
Switch $strCmdCode
Case '-p', '--PATH'
$intCmdNum = $intCmdNum +1
$SourceRepositoryPath = _GetThisArg($intCmdNum)
Case '-e', '--EXT'
$intCmdNum = $intCmdNum +1
$FileExt = _GetThisArg($intCmdNum)
EndSwitch
$intCmdNum = $intCmdNum +1
WEnd
EndFunc ;==>_ParseCmdLine
Func _GetThisArg($_n)
If $CmdLine[0] = 0 or $CmdLine[0] < $_n then Return ""
Return $CmdLine[$_n]
EndFunc ;==>_GetThisArg
Local $intCmdTotal = _GetThisArg(0)
Local $intCmdNum = 1
Local $strCmdCode
While $intCmdNum <= $intCmdTotal
$strCmdCode = _GetThisArg($intCmdNum)
Switch $strCmdCode
Case '-p', '--PATH'
$intCmdNum = $intCmdNum +1
$SourceRepositoryPath = _GetThisArg($intCmdNum)
Case '-e', '--EXT'
$intCmdNum = $intCmdNum +1
$FileExt = _GetThisArg($intCmdNum)
EndSwitch
$intCmdNum = $intCmdNum +1
WEnd
EndFunc ;==>_ParseCmdLine
Func _GetThisArg($_n)
If $CmdLine[0] = 0 or $CmdLine[0] < $_n then Return ""
Return $CmdLine[$_n]
EndFunc ;==>_GetThisArg