提交 3078f652 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

rename stdin related method

上级 0bdedcfc
......@@ -21,7 +21,7 @@ func CommitBug(files []string) {
if len(files) > 0 {
resultDir = files[0]
} else {
stdinUtils.ConfigForDir(&resultDir, "result")
stdinUtils.InputForDir(&resultDir, "result")
}
resultDir = fileUtils.UpdateDir(resultDir)
......
......@@ -14,12 +14,12 @@ import (
func Generate(productId string, moduleId string, suiteId string, taskId string,
independentFile bool, scriptLang string) {
stdinUtils.CheckConfigForRequest()
stdinUtils.CheckRequestConfig()
if (productId != "") || (moduleId != "" && productId != "") || suiteId != "" || taskId != "" {
} else {
stdinUtils.ConfigForCheckout(&productId, &moduleId, &suiteId, &taskId,
stdinUtils.InputForCheckout(&productId, &moduleId, &suiteId, &taskId,
&independentFile, &scriptLang)
}
......
......@@ -11,7 +11,7 @@ func CommitResult(files []string) {
if len(files) > 0 {
resultDir = files[0]
} else {
stdinUtils.ConfigForDir(&resultDir, "result")
stdinUtils.InputForDir(&resultDir, "result")
}
resultDir = fileUtils.UpdateDir(resultDir)
......
......@@ -28,7 +28,7 @@ func Run(files []string, suiteIdStr string, taskIdStr string) {
suiteId, err := strconv.Atoi(suiteIdStr)
if err == nil && suiteId > 0 {
stdinUtils.CheckConfigForRequest()
stdinUtils.CheckRequestConfig()
zentaoService.GetCaseIdsBySuite(suiteIdStr, &caseIdMap)
}
......@@ -37,7 +37,7 @@ func Run(files []string, suiteIdStr string, taskIdStr string) {
taskId, err := strconv.Atoi(taskIdStr)
if err == nil && taskId > 0 {
stdinUtils.CheckConfigForRequest()
stdinUtils.CheckRequestConfig()
zentaoService.GetCaseIdsByTask(taskIdStr, &caseIdMap)
}
......
......@@ -108,7 +108,7 @@ func main() {
}
case "set", "-s":
stdinUtils.ConfigForSet()
stdinUtils.InputForSet()
case "help", "-h":
logUtils.PrintUsage()
......
......@@ -13,7 +13,7 @@ import (
"strings"
)
func ConfigForSet() {
func InputForSet() {
configSite := ""
language := ""
......@@ -51,14 +51,14 @@ func ConfigForSet() {
configUtils.PrintCurrConfig()
}
func CheckConfigForRequest() {
func CheckRequestConfig() {
conf := configUtils.ReadCurrConfig()
if conf.Url == "" || conf.Account == "" || conf.Password == "" {
ConfigForRequest()
InputForRequest()
}
}
func ConfigForRequest() {
func InputForRequest() {
url := ""
account := ""
password := ""
......@@ -74,7 +74,7 @@ func ConfigForRequest() {
configUtils.PrintCurrConfig()
}
func ConfigForCheckout(productId *string, moduleId *string, suiteId *string, taskId *string,
func InputForCheckout(productId *string, moduleId *string, suiteId *string, taskId *string,
independentFile *bool, scriptLang *string) {
coType := getInput("(product|module|suite|task|p|m|s|t)", "enter_co_type")
......@@ -109,11 +109,11 @@ func ConfigForCheckout(productId *string, moduleId *string, suiteId *string, tas
configUtils.PrintCurrConfig()
}
func ConfigForDir(dir *string, entity string) {
func InputForDir(dir *string, entity string) {
*dir = getInput("is_dir", "enter_dir", i118Utils.I118Prt.Sprintf(entity))
}
func ConfigForInt(in *string, entity string) {
func InputForInt(in *string, entity string) {
*in = getInput("\\d+", "enter_id", i118Utils.I118Prt.Sprintf(entity))
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册