Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulCatalinas committed Dec 8, 2024
2 parents ff33198 + c4fcbc0 commit 07e36cb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"MD029": false
},
"cSpell.words": [
"Checkin"
"Checkin",
"webbrowser"
]
}
21 changes: 16 additions & 5 deletions internal/cli/show_help.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,29 @@ package cli

import (
"fmt"
"strings"

"github.com/RaulCatalinas/HuskyBC/internal/types"
)

func ShowHelp(options []types.Option) {
fmt.Print("Usage: huskybc [options]\n\n")
fmt.Print("Command line for easy Husky configuration\n\n")
fmt.Println("Options:")
var builder strings.Builder

builder.WriteString("Usage: huskybc [options]\n\n")
builder.WriteString("Command line for easy Husky configuration\n\n")
builder.WriteString("Options:\n")

for _, option := range options {
fmt.Printf("%-15s %-5s %s\n", option.Name, option.Alias, option.Description)
fmt.Fprintf(
&builder,
"%-15s %-5s %s\n",
option.Name,
option.Alias,
option.Description,
)
}

fmt.Println()
builder.WriteString("\n")

fmt.Print(builder.String())
}
7 changes: 1 addition & 6 deletions internal/handlers/handlers_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package handlers

import (
"os"
"time"

"github.com/RaulCatalinas/HuskyBC/internal/constants"
"github.com/RaulCatalinas/HuskyBC/internal/enums"
Expand All @@ -18,11 +17,7 @@ func HandlerOptionCollaborate() {
Message: "Opening the GitHub repository...",
})

time.Sleep(5 * time.Millisecond)

err := webbrowser.Open(constants.REPOSITORY)

if err != nil {
if err := webbrowser.Open(constants.REPOSITORY); err != nil {
utils.WriteMessage(utils.WriteMessageProps{
Type: enums.MessageTypeError,
Message: errorMessages.PROCESS_ERROR_MESSAGES[enums.GitHubRepoOpenError],
Expand Down

0 comments on commit 07e36cb

Please sign in to comment.