Skip to content

Commit c7d16e0

Browse files
authored
Merge pull request #62 from AvicennaJr/develop
Develop
2 parents a18cce4 + 3037476 commit c7d16e0

File tree

1 file changed

+13
-22
lines changed

1 file changed

+13
-22
lines changed

main.go

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package main
22

33
import (
44
"fmt"
5-
"io/ioutil"
65
"os"
76
"strings"
87

@@ -19,6 +18,16 @@ var (
1918
Version = styles.VersionStyle.Render("v0.5.1")
2019
Author = styles.AuthorStyle.Render("by Avicenna")
2120
NewLogo = lipgloss.JoinVertical(lipgloss.Center, Title, lipgloss.JoinHorizontal(lipgloss.Center, Author, " | ", Version))
21+
Help = styles.HelpStyle.Italic(false).Render(fmt.Sprintf(`💡 Namna ya kutumia Nuru:
22+
%s: Kuanza programu ya Nuru
23+
%s: Kuendesha faili la Nuru
24+
%s: Kusoma nyaraka za Nuru
25+
%s: Kufahamu toleo la Nuru
26+
`,
27+
styles.HelpStyle.Bold(true).Render("nuru"),
28+
styles.HelpStyle.Bold(true).Render("nuru jinaLaFile.nr"),
29+
styles.HelpStyle.Bold(true).Render("nuru --nyaraka"),
30+
styles.HelpStyle.Bold(true).Render("nuru --toleo")))
2231
)
2332

2433
func main() {
@@ -36,16 +45,7 @@ func main() {
3645

3746
switch args[1] {
3847
case "msaada", "-msaada", "--msaada", "help", "-help", "--help", "-h":
39-
fmt.Println(styles.HelpStyle.Italic(false).Render(fmt.Sprintf(`💡 Namna ya kutumia Nuru:
40-
%s: Kuanza programu ya Nuru
41-
%s: Kuendesha faili la Nuru
42-
%s: Kusoma nyaraka za Nuru
43-
%s: Kufahamu toleo la Nuru
44-
`,
45-
styles.HelpStyle.Bold(true).Render("nuru"),
46-
styles.HelpStyle.Bold(true).Render("nuru jinaLaFile.nr"),
47-
styles.HelpStyle.Bold(true).Render("nuru --nyaraka"),
48-
styles.HelpStyle.Bold(true).Render("nuru --toleo"))))
48+
fmt.Println(Help)
4949
os.Exit(0)
5050
case "version", "-version", "--version", "-v", "v", "--toleo", "-toleo":
5151
fmt.Println(NewLogo)
@@ -58,7 +58,7 @@ func main() {
5858
file := args[1]
5959

6060
if strings.HasSuffix(file, "nr") || strings.HasSuffix(file, ".sw") {
61-
contents, err := ioutil.ReadFile(file)
61+
contents, err := os.ReadFile(file)
6262
if err != nil {
6363
fmt.Println(styles.ErrorStyle.Render("Error: Nuru imeshindwa kusoma faili: ", args[1]))
6464
os.Exit(0)
@@ -72,16 +72,7 @@ func main() {
7272

7373
} else {
7474
fmt.Println(styles.ErrorStyle.Render("Error: Operesheni imeshindikana boss."))
75-
fmt.Println(styles.HelpStyle.Italic(false).Render(fmt.Sprintf(`💡 Namna ya kutumia Nuru:
76-
%s: Kuanza programu ya Nuru
77-
%s: Kuendesha faili la Nuru
78-
%s: Kusoma nyaraka za Nuru
79-
%s: Kufahamu toleo la Nuru
80-
`,
81-
styles.HelpStyle.Bold(true).Render("nuru"),
82-
styles.HelpStyle.Bold(true).Render("nuru jinaLaFile.nr"),
83-
styles.HelpStyle.Bold(true).Render("nuru --nyaraka"),
84-
styles.HelpStyle.Bold(true).Render("nuru --toleo"))))
75+
fmt.Println(Help)
8576
os.Exit(0)
8677
}
8778
}

0 commit comments

Comments
 (0)