Skip to content

Commit

Permalink
++
Browse files Browse the repository at this point in the history
  • Loading branch information
sinalalebakhsh committed Oct 9, 2023
1 parent 280d665 commit d52fd7d
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 37 deletions.
14 changes: 14 additions & 0 deletions GetUserInput/GetUserInput.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ func GetUserInput() {
Regular = IfUserisHELP(FinalInput) // If FinalInput is or does't "help" return true
}

if Regular {
Regular = IfUserisCLEAR(FinalInput)
}


if Regular {
if FirstCount {
Regular = GetUserForBrowser(FinalInput)
Expand Down Expand Up @@ -75,6 +80,7 @@ func IfUsrisEXIT(FinalInput string) bool {
Exit := "exit"
if FinalInput == strings.ToLower(Exit) {
features.GoodByePrint()
features.ClearTerminal()
os.Exit(0)
}
return true
Expand All @@ -89,6 +95,14 @@ func IfUserisHELP(FinalInput string) bool {
return true
}

func IfUserisCLEAR(FinalInput string) bool {
if FinalInput == strings.ToLower("clear") {
features.ClearTerminal()
return false
}
return true
}

func GetUserForBrowser(userInput string) bool {
if strings.ToLower(userInput) == "yes" {
openBrowser()
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,9 @@ You can use this command before start:
ALLHTTPSERVERS
ALL CREATING HTTP SERVERS
ALLCREATINGHTTPSERVERS
ALL HTTP CLIENTS
ALLHTTPCLIENTS
ALL CREATING HTTP CLIENTS
ALLCREATINGHTTPCLIENTS

🌎🌏🌐🏀⚽⚾🥎🏐🔴🟠🟡🟢🔵🟣🟤🔘🍘🥘🫓🏵🐻🍅🍑🍊🍈🌳❤️🎾🏕🏜🍺🫖🎳🎖🥇🥈🥉🎃🔥💧🌈⭐🌟🏎🏍🚂🟥🟧🟨🟩🟦🟪🟫🔶🔷💠✅🔆⏺⏹🛡🔒📌🗂📂💰📔📕📖📗📘📙📚📓📒🎥📽📹🖥💻🎹🎵🔔💍🎨
8 changes: 8 additions & 0 deletions features/CreatingHTTPClients.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package features

var TitleHTTPClients = []string{
"ALL HTTP CLIENTS",
"ALLHTTPCLIENTS",
"ALL CREATING HTTP CLIENTS",
"ALLCREATINGHTTPCLIENTS",
}
23 changes: 21 additions & 2 deletions features/Printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import (
"fmt"
"strings"
"time"

"github.com/fatih/color"
"os/exec"
"runtime"
"os"
)

func SplitIntoWords(text string) []string {
Expand Down Expand Up @@ -40,4 +42,21 @@ func GoodByePrint(){
| GoodBye |
└─────────────────┘
`)
}
}

func ClearTerminal() {
var cmd *exec.Cmd

switch runtime.GOOS {
case "linux", "darwin":
cmd = exec.Command("clear")
case "windows":
cmd = exec.Command("cmd", "/c", "cls")
default:
fmt.Println("Unsupported operating system")
return
}

cmd.Stdout = os.Stdout
cmd.Run()
}
99 changes: 64 additions & 35 deletions features/helpMessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package features

import (
"fmt"
"time"

"github.com/fatih/color"
)

Expand All @@ -25,6 +27,12 @@ var LOGO string = fmt.Sprintln(` ───────────────
• •
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
─────────────────────────────────────────────────────────────────────────────────────────────────────────────`)
var TitleOfHelp = []string{
"-h",
"help",
"-help",
"--help",
}

var Message string = fmt.Sprintln(`
my name is Sina LalehBakhsh, I hope this API is useful for you
Expand All @@ -36,48 +44,69 @@ like this:

func HelpMessage() {
color.HiBlue(`
┌───────────────────┐
| GoCron v1.0.16 |
└───────────────────┘
`)
┌───────────────────┐
| GoCron v1.0.16 |
└───────────────────┘`)
words := SplitIntoWords(Message)
PrintWordByWord(words)
fmt.Println()
color.HiBlue(fmt.Sprintln(`You can use this command before start:
◉============ Run
1-
go run .
◉============ Build
1-
go build .
2-
./Gocron
◉============ Help
./Gocron -h
./Gocron help
./Gocron -help
./Gocron --help
time.Sleep(time.Second * 2)
color.HiBlue(fmt.Sprintln("You can use this command before start:"))
time.Sleep(time.Second * 2)
color.HiBlue(fmt.Sprintln(`Run
go run .
◉============ Show All
Build
go build .
./Gocron
Help
./Gocron -h
./Gocron help
./Gocron -help
./Gocron --help
Show All
./Gocron all
./Gocron -all
./Gocron --all
`))
color.HiCyan(fmt.Sprintln(`
example command after run program:
help
./Gocron --all`))
time.Sleep(time.Second * 2)
color.HiCyan(fmt.Sprintln("example command after run program:"))
time.Sleep(time.Second * 2)
color.HiCyan(fmt.Sprintln(` help
for example
all regex
goroutines and channels
`))

}
goroutines and channels`))
time.Sleep(time.Second * 2)
color.HiMagenta(fmt.Sprintln("if just write one input you get all about that:"))
time.Sleep(time.Second * 2)
color.HiMagenta(fmt.Sprintln(` READING AND WRITING DATA
READINGANDWRITINGDATA
ALL READING AND WRITING DATA
ALLREADINGANDWRITINGDATA
ALL REGEX
ALLREGEX
ALL TIME
ALLTIME
ALL HTML AND TEMPLATE
ALLHTMLANDTEMPLATE
ALL WORKING WITH FILES
ALLWORKINGWITHFILES
ALL JSON
ALLJSON
ALL JSON DATA
ALLJSONDATA
ALL WORK WITH JSON DATA
ALLWORKWITHJSONDATA
ALL WORKING WITH JSON DATA
ALLWORKINGWITHJSONDATA
ALL HTTP SERVERS
ALLHTTPSERVERS
ALL CREATING HTTP SERVERS
ALLCREATINGHTTPSERVERS
ALL HTTP CLIENTS
ALLHTTPCLIENTS
ALL CREATING HTTP CLIENTS
ALLCREATINGHTTPCLIENTS`))

var TitleOfHelp = []string{
"-h",
"help",
"-help",
"--help",
}

0 comments on commit d52fd7d

Please sign in to comment.