summaryrefslogtreecommitdiff
path: root/interact.go
diff options
context:
space:
mode:
Diffstat (limited to 'interact.go')
-rw-r--r--interact.go33
1 files changed, 18 insertions, 15 deletions
diff --git a/interact.go b/interact.go
index 14e591f..3f3339b 100644
--- a/interact.go
+++ b/interact.go
@@ -21,7 +21,7 @@ func interact() {
//fmt.Println(os.Args)
//cyan := color.New(color.FgCyan).SprintFunc()
//yellow := color.New(color.FgYellow).SprintFunc()
- green := color.New(color.FgGreen).SprintFunc()
+ //green := color.New(color.FgGreen).SprintFunc()
boldBlue := color.New(color.FgBlue, color.Bold).SprintFunc()
boldRed := color.New(color.FgRed, color.Bold).SprintFunc()
boldMag := color.New(color.FgMagenta, color.Bold).SprintFunc()
@@ -359,7 +359,7 @@ func interact() {
arg := "none"
if len(c.Args) > 0 {
arg = strings.Join(c.Args, " ")
- newTaskTime(currproject.id, arg)
+ newTaskTime(arg)
stdOut()
} else {
c.Println(boldRed("start <DateTime> - Please enter a Datetime"))
@@ -670,7 +670,7 @@ func interact() {
}
}
billid, billident := newBill(billprojid)
- c.Println(green("Bill Completed"))
+ //c.Println(green("Bill Completed"))
fullbill := bill{billid, billident, dur, proj.id, proj.name, time.Time{}, time.Time{}, allitems}
saveBill(fullbill)
checkTasks(selids, billid)
@@ -740,15 +740,15 @@ func getInterInput(question string) (out string) {
return
}
-func getNewInterInput(question, old string) string {
+func getNewInterInput(question, old, border string) string {
shell := ishell.New()
shell.ShowPrompt(false)
defer shell.ShowPrompt(true)
if old != "" {
- shell.Println("Current:", old)
+ shell.Println(border+"Current:", old)
}
- shell.Print(question)
+ shell.Print(border+question)
line := shell.ReadLine()
if line == "" {
@@ -762,29 +762,32 @@ func getInterMultiInput(question string) (out string) {
shell := ishell.New()
//shell.ShowPrompt(false)
//defer shell.ShowPrompt(true)
-
+ shell.SetPrompt(nli+">>>")
+ shell.SetMultiPrompt(nli+"...")
shell.Println(question, "(Multiline input, end with ';')")
out = shell.ReadMultiLines(";")
- shell.Println(" -Done-")
+ shell.Println(sli+" -Done-")
return
}
-func getNewInterMultiInput(question, old string) (out string) {
+func getNewInterMultiInput(question, old, border string) (out string) {
shell := ishell.New()
//shell.ShowPrompt(false)
//defer shell.ShowPrompt(true)
+ shell.SetPrompt(border+">>>")
+ shell.SetMultiPrompt(border+"...")
if old != "" {
- shell.Println("Current:\n", old)
+ shell.Println(border,"Current:\n", old)
}
- shell.Println("Should current entry be replaced? A Newline will be added otherwise")
- if isInterSure(" ") {
- shell.Println(question, "(Multiline input, end with ';')")
+ shell.Println(border,"Should current entry be replaced? A Newline will be added otherwise")
+ if isInterSure(border+" ") {
+ shell.Println(border, question, "(Multiline input, end with ';')")
out = shell.ReadMultiLines(";")
- shell.Println(" -Done-")
+ shell.Println(border," -Done-")
} else {
- shell.Print(question)
+ shell.Print(nli+question)
txt := shell.ReadLine()
if txt == "" {
out = old