mirror of
https://github.com/j3ssie/osmedeus.git
synced 2026-09-28 20:44:57 +02:00
feat: add jsonl_rename_key utility function and remove tablewriter dependency
- Add jsonl_rename_key() function to rename keys in JSONL files with mapping syntax 'old1:new1,old2:new2' - Implements fast JSON parsing with fastjson and efficient buffered I/O for large files - Include comprehensive test coverage with 7 test cases for edge cases and valid mappings - Remove unused tablewriter dependency from go.mod/go.sum and internal/terminal/table.go - Refactor printResultSummary() to use markdown table printing instead of tablewriter - Add test data file ffuf-result.jsonl for integration testing - Fix function list width default calculation in function.go
This commit is contained in:
+4
-4
@@ -435,11 +435,11 @@ func runFunctionList(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
headers := []string{"Category", "Function", "Description", "Returns"}
|
||||
if globalWidth > 0 {
|
||||
printMarkdownTableWithWidth(headers, rows, globalWidth)
|
||||
} else {
|
||||
printMarkdownTable(headers, rows)
|
||||
width := globalWidth
|
||||
if width <= 0 {
|
||||
width = 65
|
||||
}
|
||||
printMarkdownTableWithWidth(headers, rows, width)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
+3
-10
@@ -32,7 +32,6 @@ import (
|
||||
"github.com/j3ssie/osmedeus/v5/internal/logger"
|
||||
"github.com/j3ssie/osmedeus/v5/internal/parser"
|
||||
"github.com/j3ssie/osmedeus/v5/internal/terminal"
|
||||
"github.com/olekukonko/tablewriter"
|
||||
"github.com/spf13/cobra"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
@@ -1489,21 +1488,15 @@ func printResultSummary(result *core.WorkflowResult) {
|
||||
if len(result.Steps) > 0 {
|
||||
fmt.Println()
|
||||
fmt.Println(terminal.ResultSymbol() + " " + terminal.Bold("Step Results:"))
|
||||
table := terminal.NewTable(os.Stdout, []string{"Status", "Step", "Duration"})
|
||||
table.SetColumnAlignment([]int{
|
||||
tablewriter.ALIGN_LEFT, // Status
|
||||
tablewriter.ALIGN_LEFT, // Step
|
||||
tablewriter.ALIGN_CENTER, // Duration - center align for better visual alignment
|
||||
})
|
||||
|
||||
var rows [][]string
|
||||
for _, step := range result.Steps {
|
||||
table.Append([]string{
|
||||
rows = append(rows, []string{
|
||||
terminal.PaddedStepSymbol(string(step.Status)),
|
||||
step.StepName,
|
||||
formatDuration(step.Duration),
|
||||
})
|
||||
}
|
||||
table.Render()
|
||||
printMarkdownTable([]string{"Status", "Step", "Duration"}, rows)
|
||||
}
|
||||
|
||||
if len(result.Artifacts) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user