mirror of
https://github.com/aykhans/dodo.git
synced 2025-04-20 19:13:06 +00:00
🔨 Set max table column with in config and response packages
This commit is contained in:
parent
3b30f2a64b
commit
94a74c64b7
@ -42,7 +42,9 @@ func (config *RequestConfig) Print() {
|
|||||||
t := table.NewWriter()
|
t := table.NewWriter()
|
||||||
t.SetOutputMirror(os.Stdout)
|
t.SetOutputMirror(os.Stdout)
|
||||||
t.SetStyle(table.StyleLight)
|
t.SetStyle(table.StyleLight)
|
||||||
t.SetAllowedRowLength(125)
|
t.SetColumnConfigs([]table.ColumnConfig{
|
||||||
|
{Number: 2, WidthMax: 50},
|
||||||
|
})
|
||||||
|
|
||||||
t.AppendHeader(table.Row{"Request Configuration"})
|
t.AppendHeader(table.Row{"Request Configuration"})
|
||||||
t.AppendRow(table.Row{"Method", config.Method})
|
t.AppendRow(table.Row{"Method", config.Method})
|
||||||
|
6
main.go
6
main.go
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
@ -84,11 +85,10 @@ func main() {
|
|||||||
requestConf.Print()
|
requestConf.Print()
|
||||||
if !cliConf.Yes {
|
if !cliConf.Yes {
|
||||||
response := readers.CLIYesOrNoReader("Do you want to continue?", true)
|
response := readers.CLIYesOrNoReader("Do you want to continue?", true)
|
||||||
if response {
|
if !response {
|
||||||
utils.PrintlnC(utils.Colors.Green, "Starting Dodo\n")
|
|
||||||
} else {
|
|
||||||
utils.PrintAndExit("Exiting...")
|
utils.PrintAndExit("Exiting...")
|
||||||
}
|
}
|
||||||
|
fmt.Println()
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
@ -57,7 +57,10 @@ func (respones Responses) Print() {
|
|||||||
t := table.NewWriter()
|
t := table.NewWriter()
|
||||||
t.SetOutputMirror(os.Stdout)
|
t.SetOutputMirror(os.Stdout)
|
||||||
t.SetStyle(table.StyleLight)
|
t.SetStyle(table.StyleLight)
|
||||||
t.SetAllowedRowLength(125)
|
t.SetColumnConfigs([]table.ColumnConfig{
|
||||||
|
{Number: 1, WidthMax: 80},
|
||||||
|
})
|
||||||
|
|
||||||
t.AppendHeader(table.Row{
|
t.AppendHeader(table.Row{
|
||||||
"Response",
|
"Response",
|
||||||
"Count",
|
"Count",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user