Skip to content

Commit

Permalink
docs(cmd): Fixes Some Doc Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jshlbrd committed Oct 2, 2024
1 parent 81e5b0f commit 95f71ab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions cmd/substation/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ partially normalized to the Elastic Common Schema (ECS).
message.New().AsControl(),
}

// Make the input pretty before printing to the console.
fmt.Printf("input:\n%s\n", gjson.Get(evt, "@this|@pretty").String())
fmt.Printf("output:\n")

if _, err := sub.Transform(ctx, msgs...); err != nil {
return err
}

fmt.Printf("\n")
fmt.Printf("config:%s\n", demoConf)
fmt.Printf("\nconfig:%s\n", demoConf)

return nil
},
Expand Down
16 changes: 8 additions & 8 deletions cmd/substation/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ production resources, such as any enrichment or send transforms.
// Examples:
// substation test [-R]
// substation test [-R] /path/to/configs
// substation test /path/to/config.json
// substation test /path/to/config.jsonnet
// substation test /path/to/my.libsonnet
// substation test /path/to/config.json
// substation test /path/to/config.jsonnet
// substation test /path/to/my.libsonnet
Example: ` substation test [-R]
substation test [-R] /path/to/configs
substation test /path/to/config.json
Expand Down Expand Up @@ -247,8 +247,7 @@ production resources, such as any enrichment or send transforms.
return err
}

// If the arg is a file, then test that file. If the
// arg is also not a directory, then return a warning.
// If the arg is a file, then test only that file.
if !fi.IsDir() {
var cfg customConfig

Expand Down Expand Up @@ -280,9 +279,10 @@ production resources, such as any enrichment or send transforms.
}

var entries []string
// Walk to get all files in the directory that end with `.json`.
// These are assumed to be Substation configuration files, and
// are validated before attempting to run tests.
// Walk to get all valid files in the directory.
//
// These are assumed to be Substation configuration files,
// and are validated before attempting to run tests.
if err := filepath.WalkDir(arg, func(path string, d os.DirEntry, err error) error {
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions transform/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ func New(ctx context.Context, cfg config.Config) (Transformer, error) { //nolint
return newStringSplit(ctx, cfg)
case "string_uuid":
return newStringUUID(ctx, cfg)
// Test transforms.
// Test transforms.
case "test_message":
return newTestMessage(ctx, cfg)
// Time transforms.
// Time transforms.
case "time_from_string":
return newTimeFromString(ctx, cfg)
case "time_from_unix":
Expand Down

0 comments on commit 95f71ab

Please sign in to comment.