Skip to content

Commit b0f3497

Browse files
committed
Add error message for no arguments
1 parent 101a4d5 commit b0f3497

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main.go

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"fmt"
45
"os"
56

67
"hudson-newey/2rm/src/config"
@@ -11,6 +12,11 @@ import (
1112
func main() {
1213
originalArguments := os.Args[1:]
1314

15+
if (len(originalArguments) == 0) {
16+
fmt.Println("2rm: missing operand\nTry '2rm --help' for more information")
17+
os.Exit(1)
18+
}
19+
1420
homeLocation := os.Getenv("HOME")
1521
defaultConfigDirectory := homeLocation + "/.local/share/2rm/config.yml"
1622
parsedConfig := models.Config{}

0 commit comments

Comments
 (0)