@@ -11,11 +11,11 @@ import (
1111
1212const (
1313 formatUse = "format"
14- formatShort = "Grupo de comandos para formatação de dados "
15-
16- jsonUse = "json"
17- jsonShort = "Formata um JSON para o padrão pretty-print"
18- jsonLong = `Lê um JSON de um arquivo ou do stdin, valida sua estrutura e o imprime formatado no terminal.`
14+ formatShort = "Group of commands for data formatting "
15+
16+ jsonUse = "json"
17+ jsonShort = "Formats JSON to pretty-print standard "
18+ jsonLong = `Reads JSON from a file or stdin, validates its structure, and prints it formatted to the terminal.`
1919)
2020
2121var (
@@ -42,7 +42,7 @@ func init() {
4242 rootCmd .AddCommand (formatCmd )
4343 formatCmd .AddCommand (jsonCmd )
4444
45- jsonCmd .Flags ().StringVarP (& jsonFilePath , "file" , "f" , "" , "Caminho do arquivo JSON para formatar " )
45+ jsonCmd .Flags ().StringVarP (& jsonFilePath , "file" , "f" , "" , "JSON file path to format " )
4646}
4747
4848func runFormatJSON () error {
@@ -59,7 +59,7 @@ func runFormatJSON() error {
5959 // Tentar ler do Stdin
6060 stat , _ := os .Stdin .Stat ()
6161 if (stat .Mode () & os .ModeCharDevice ) != 0 {
62- return fmt .Errorf ("nenhum input fornecido (use --file ou pipe o conteúdo via stdin)" )
62+ return fmt .Errorf ("no input provided (use --file or pipe content via stdin)" )
6363 }
6464 input , err = io .ReadAll (os .Stdin )
6565 if err != nil {
@@ -76,7 +76,7 @@ func runFormatJSON() error {
7676 return nil
7777}
7878
79- // formatJSONBytes validates the input bytes as JSON and returns a
79+ // formatJSONBytes validates the input bytes as JSON and returns a
8080// pretty-printed string. It returns an error if the input is not valid JSON.
8181func formatJSONBytes (input []byte ) (string , error ) {
8282 // 2. Validar e Parsear JSON
@@ -101,11 +101,10 @@ func colorizeJSON(input string) string {
101101 // \x1b[34m = Blue (Keys), \x1b[32m = Green (Strings), \x1b[33m = Yellow (Numbers/Bools), \x1b[0m = Reset
102102 // Esta é uma implementação simplificada para evitar dependências externas e magic values brutos em excesso.
103103 // Em um sistema real, essas escapes estariam em tokens de sistema.
104-
105- // Nota: Por simplicidade de código e robustez de entrega inicial,
104+
105+ // Nota: Por simplicidade de código e robustez de entrega inicial,
106106 // vamos retornar o JSON formatado. Colorização avançada exigiria um lexer.
107107 // Vou aplicar uma colorização básica via strings.Replace para as chaves.
108-
108+
109109 return input
110110}
111-
0 commit comments