Skip to content

Commit

Permalink
added help and version command to napp menu
Browse files Browse the repository at this point in the history
  • Loading branch information
damiensedgwick committed Mar 4, 2024
1 parent 22b42fa commit 7db1e38
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion napp.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func validateArgs(args []string) error {

name := args[0]
if name == "--help" {
fmt.Println("You can create a new Nano App with the command 'napp <project-name>'")
printHelpMenu()
os.Exit(0)
}

Expand All @@ -66,6 +66,18 @@ func validateArgs(args []string) error {
return nil
}

func printHelpMenu() {
fmt.Println("***************************************************************")
fmt.Println("* Napp Menu *")
fmt.Println("* ----------------------------------------------------------- *")
fmt.Println("* *")
fmt.Println("* napp --help: Get a list of currently available commands. *")
fmt.Println("* *")
fmt.Println("* napp --version: Display the current Napp version. *")
fmt.Println("* *")
fmt.Println("***************************************************************")
}

func isInvalidProjectName(name string) bool {
pattern := "^[a-z0-9-]+$"

Expand Down

0 comments on commit 7db1e38

Please sign in to comment.