describe for core

Describe the type and structure of the value(s) piped in.

Signature

> describe {flags}

Flags

  • --no-collect, -n: do not collect streams of structured data
  • --detailed, -d: show detailed information about the value
  • --collect-lazyrecords, -l: collect lazy records

Input/output types:

inputoutput
anyany

Examples

Describe the type of a string

> 'hello' | describe
string

Describe the type of a record in a detailed way

> {shell:'true', uwu:true, features: {bugs:false, multiplatform:true, speed: 10}, fib: [1 1 2 3 5 8], on_save: {|x| print $'Saving ($x)'}, first_commit: 2019-05-10, my_duration: (4min + 20sec)} | describe -d
╭─────────┬───────────────────────────────────────────────────────────╮
 type record
 lazy false
 ╭──────────────┬────────────────────────────────────────╮
 columns shell string
 uwu bool
 ╭─────────┬──────────────────────────╮
 features type record
 lazy false
 ╭───────────────┬──────╮
 columns bugs bool
 multiplatform bool
 speed int
 ╰───────────────┴──────╯
 ╰─────────┴──────────────────────────╯
 ╭────────┬─────────────╮
 fib type list
 length 6
 ╭───┬─────╮
 values 0 int
 1 int
 2 int
 3 int
 4 int
 5 int
 ╰───┴─────╯
 ╰────────┴─────────────╯
 ╭───────────┬────────────────────────╮
 on_save type closure
 ╭──────────┬─────────╮
 signature name
 category default
 ╰──────────┴─────────╯
 ╰───────────┴────────────────────────╯
 first_commit date
 my_duration duration
 ╰──────────────┴────────────────────────────────────────╯
╰─────────┴───────────────────────────────────────────────────────────╯

Describe the type of a stream with detailed information

> [1 2 3] | each {|i| echo $i} | describe -d

Describe a stream of data, collecting it first

> [1 2 3] | each {|i| echo $i} | describe

Describe the input but do not collect streams

> [1 2 3] | each {|i| echo $i} | describe --no-collect