fixed so that the help flags work

This commit is contained in:
Laukka 2025-01-13 10:02:50 +01:00
parent 13a510550e
commit 84b969a98c
4 changed files with 4 additions and 1 deletions

View File

@ -26,6 +26,7 @@ func Head(in input_parser.Input, env *environment.Env) {
for _, flag := range flagsArray {
fmt.Println(flag + flagsDictionary[flag])
} // Print flags and there description
return
}
args := in.Args
var file_path string

View File

@ -23,6 +23,7 @@ func Ls(in input_parser.Input, env *environment.Env) {
for _, flag := range flagsArray {
fmt.Println(flag + flagsDictionary[flag])
} // Print flags and their description
return
}
fs, err := os.ReadDir(env.Path)
if err != nil {

View File

@ -21,7 +21,7 @@ func Man(in input_parser.Input, env *environment.Env) {
case "cat":
fmt.Print("Outputs the contents of the given file")
case "head":
fmt.Print("Outputs first lines of a given file. 10 if none provided. Argument <file> <number of lines> \nTakes the flag -n in order to display the line numbers")
fmt.Print("Outputs first lines of a given file. 10 if none or 0 is provided. Argument <file> <number of lines> \nTakes the flag -n in order to display the line numbers")
case "touch":
fmt.Print("Creates the given file")
case "rm":

View File

@ -28,6 +28,7 @@ func Tail(in input_parser.Input, env *environment.Env) {
for _, flag := range flagsArray {
fmt.Println(flag + flagsDictionary[flag])
} // Print flags and there description
return
}
args := in.Args
var file_path string