1
1
mirror of https://github.com/wader/fq.git synced 2024-12-23 05:13:30 +03:00

Merge pull request #115 from wader/doc-example-usages

doc,interp: Add some example usages to cli help
This commit is contained in:
Mattias Wadman 2022-01-29 12:26:08 +01:00 committed by GitHub
commit 2efc3cba9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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