From 812d977fcc902a2933d9bca077c3dd40f8c21a43 Mon Sep 17 00:00:00 2001 From: echo <91651232+exhq@users.noreply.github.com> Date: Sun, 25 Dec 2022 09:37:48 +0330 Subject: [PATCH] wow --help my beloved is here --- .gitignore | 1 + data/data.go | 1 - main.go | 22 +++++++++++++++++----- utils/args.go | 5 ++++- 4 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ba2906d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +main diff --git a/data/data.go b/data/data.go index a50a095..5a502e7 100644 --- a/data/data.go +++ b/data/data.go @@ -27,7 +27,6 @@ func GetLocalIP() string { return "" } for _, address := range addrs { - // check the address type and if it is not a loopback the display it if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() { if ipnet.IP.To4() != nil { return ipnet.IP.String() diff --git a/main.go b/main.go index 69fd71a..1f5a71f 100644 --- a/main.go +++ b/main.go @@ -20,15 +20,12 @@ func checkforconfigfolder() { os.Mkdir(data.GetHome()+"/.config", os.ModePerm) } } -func getSubstring(s string, indices []int) string { - return string(s[indices[0]:indices[1]]) -} func getShellVersion(shellCommand string) string { // https://www.youtube.com/watch?v=YPN0qhSyWy8 cmd := shellCommand + " --version | grep -o -E \"([0-9]\\.?)*\" | head -n1" out, _ := exec.Command("bash", "-c", cmd).Output() - return shellCommand + " " + strings.ReplaceAll(string(out), "\n", "") + return filepath.Base(shellCommand) + " " + strings.ReplaceAll(string(out), "\n", "") } func handleConfig() { @@ -105,10 +102,25 @@ func handlePrint(action, format string, rest string) { } } } +func runpage() { + if utils.Ishelp { + println(`neowofetch version x (idk how to implement this) +--nouwu turns off uwuifying +--usepng uses a png (only supports arch and ubuntu rn) +--noascii turns off the ascii +--nocolor no color. +--noconf uses builtin config instead of looking for one in the filesystem +--nocolorconf same thing but for color config :P +--16color uses escape codes instead of RGB +--help YOU LITERALLY FUCKING RAN IT RIGHT NOW`) + os.Exit(0) + } +} func main() { - checkforconfigfolder() utils.Initargs() + runpage() + checkforconfigfolder() utils.Initcolor() utils.CutePrintInit() handleConfig() diff --git a/utils/args.go b/utils/args.go index 8992ebd..a6df40f 100644 --- a/utils/args.go +++ b/utils/args.go @@ -18,6 +18,7 @@ var Forceddistro string var Defaultconf bool = false var Defaultcolor bool = false var colorold bool = false +var Ishelp bool = false func Gethn() string { cmd := exec.Command("whoami") @@ -50,8 +51,10 @@ func Initargs() { Defaultcolor = true case "--16color": colorold = true + case "--help": + Ishelp = true default: - print("unknown argument: ", argument, "\n") + print("unknown argument: ", argument, ". please run --help for help\n") os.Exit(0) } }