Skip to content

Commit

Permalink
Hide "fii mensal" from menu
Browse files Browse the repository at this point in the history
* Hide during development of this new command
* Show example on "fii rendimento"
  • Loading branch information
dude333 committed Feb 20, 2024
1 parent 9843d89 commit eac8010
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
7 changes: 7 additions & 0 deletions cmd/rapina/fii.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Distributed under the MIT License.
package main

import (
"fmt"
"os"
"path/filepath"

"github.com/spf13/cobra"
)

Expand All @@ -22,6 +26,9 @@ var fiiCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
_ = cmd.Help()
},
Example: func() string {
return fmt.Sprintf("%s fii rendimentos KNIP11 KNCR11 HGLG11 -n 4", filepath.Base(os.Args[0]))
}(),
}

func init() {
Expand Down
6 changes: 6 additions & 0 deletions cmd/rapina/fii_dividends.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ Distributed under the MIT License.
package main

import (
"fmt"
"log"
"os"
"path/filepath"
"strings"

"github.com/dude333/rapina/reports"
Expand Down Expand Up @@ -44,6 +47,9 @@ var fiiDividendsCmd = &cobra.Command{
}

},
Example: func() string {
return fmt.Sprintf("%s fii rendimentos KNIP11 KNCR11 HGLG11 -n 4", filepath.Base(os.Args[0]))
}(),
}

func init() {
Expand Down
3 changes: 1 addition & 2 deletions cmd/rapina/fii_monthly.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type fiiMonthlyFlags struct {

// fiiMonthlyCmd represents the rendimentos command
var fiiMonthlyCmd = &cobra.Command{
Hidden: true,
Use: "mensal",
Aliases: []string{"monthly"},
Args: cobra.MinimumNArgs(1),
Expand Down Expand Up @@ -49,10 +50,8 @@ func init() {
"f", "tabela", "formato do relatório: tabela|csv|csvrend")
}

//
// FIIMonthly prints the monthly reports from 'code' for 'n' months,
// starting from latest.
//
func FIIMonthly(parms map[string]string, codes []string, n int) error {
for i := 0; i < len(codes); i++ {
codes[i] = strings.ToUpper(codes[i])
Expand Down
4 changes: 2 additions & 2 deletions cmd/rapina/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ func init() {
Aliases:
{{.NameAndAliases}}{{end}}{{if .HasExample}}
Exemples:
{{.Example}}{{end}}{{if .HasAvailableSubCommands}}
Exemplos:
{{.Example}}{{end}}{{if .HasAvailableSubCommands}}
Comandos Disponíveis:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}}
{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}
Expand Down

0 comments on commit eac8010

Please sign in to comment.