diff --git a/doc/usage.md b/doc/usage.md index ba1c238a..5af3b330 100644 --- a/doc/usage.md +++ b/doc/usage.md @@ -298,6 +298,14 @@ For more information see https://github.com/wader/fq Usage: fq [OPTIONS] [--] [EXPR] [FILE...] +Example usages: + fq . file + fq d file + fq tovalue file + cat file.cbor | fq -d cbor torepr + fq 'grep("^main$") | parent' /bin/ls + fq 'grep_by(format == "exif") | d' *.png *.jpeg + --arg NAME VALUE Set variable $NAME to string VALUE --argjson NAME JSON Set variable $NAME to JSON --color-output,-C Force color output diff --git a/pkg/interp/interp.jq b/pkg/interp/interp.jq index bb352a54..a13f7603 100644 --- a/pkg/interp/interp.jq +++ b/pkg/interp/interp.jq @@ -300,6 +300,14 @@ def _main: , "" , _usage($arg0) , "" + , "Example usages:" + , " fq . file" + , " fq d file" + , " fq tovalue file" + , " cat file.cbor | fq -d cbor torepr" + , " fq 'grep(\"^main$\") | parent' /bin/ls" + , " fq 'grep_by(format == \"exif\") | d' *.png *.jpeg" + , "" , args_help_text(_opt_cli_opts) ) | println elif $opts.show_version then diff --git a/pkg/interp/testdata/args.fqtest b/pkg/interp/testdata/args.fqtest index c6071fa8..f93fce01 100644 --- a/pkg/interp/testdata/args.fqtest +++ b/pkg/interp/testdata/args.fqtest @@ -9,6 +9,14 @@ For more information see https://github.com/wader/fq Usage: fq [OPTIONS] [--] [EXPR] [FILE...] +Example usages: + fq . file + fq d file + fq tovalue file + cat file.cbor | fq -d cbor torepr + fq 'grep("^main$") | parent' /bin/ls + fq 'grep_by(format == "exif") | d' *.png *.jpeg + --arg NAME VALUE Set variable $NAME to string VALUE --argjson NAME JSON Set variable $NAME to JSON --color-output,-C Force color output