Skip to content

Commit 2ce6e20

Browse files
committed
fix: cambio formato mensaje de ayuda issue gophers-latam#2
Signed-off-by: Gabriel Pozo <[email protected]>
1 parent 2e1803b commit 2ce6e20

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

cmd/help.go

+12-7
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,20 @@ func RunHelp() {
1111

1212
fmt.Printf(`%s es la plantilla mínima para crear apis propuesta por la comunidad Gophers Latam usando al router chi.
1313
14-
Comandos:
14+
Comandos:
1515
16-
Serve. Sirve esta api.
17-
$ %s serve
16+
serve - Corre esta API.
1817
19-
Flags:
18+
Ejemplo
19+
$go run ./main.go serve
2020
21-
(psst! Ud. debería definir aquí sus flags si su aplicación los necesita)
21+
help - Muestra esta ayuda.
2222
23-
Help. Muestra esta ayuda.
24-
$ cart Help.`, appName, appName)
23+
Ejemplo
24+
$go run ./main.go help
25+
26+
Flags:
27+
28+
(Ud. debería definir aquí sus flags si su aplicación los necesita)
29+
`, appName)
2530
}

main.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ func init() {
3636
// main
3737
// Obtiene el comando a ejecutar desde la línea de comandos y lo invoca
3838
func main() {
39-
fmt.Printf("%s Version %s Build with Go %v at %v\n", provider.GetContainer().Config().APPName, BinVersion, BuildGoVersion, BuildTime)
4039
command := selectCmds()
4140
command()
4241
}
@@ -45,13 +44,15 @@ func main() {
4544
func selectCmds() func() {
4645

4746
if len(os.Args) == 1 {
48-
fmt.Println(`Ud. debería ejecutar esta aplicación con un comando`)
47+
fmt.Printf("Ud. debería ejecutar esta aplicación con un comando.\n\n")
4948

5049
return cmd.RunHelp
5150
}
51+
5252
// os.Args = []string{"", "serve", "-config=./config_example.yml", "-port=4999", "-log=\"./b.b\"", "-development"}
5353
switch c := os.Args[1]; c {
5454
case "serve":
55+
fmt.Printf("%s version %s Build with Go %v at %v\n", provider.GetContainer().Config().APPName, BinVersion, BuildGoVersion, BuildTime)
5556
return cmd.RunServe
5657
case "help":
5758
return cmd.RunHelp

0 commit comments

Comments
 (0)