From 9ced683c99ee52d1c498be7e10c510a55f92c984 Mon Sep 17 00:00:00 2001 From: Lena <126529524+acuteenvy@users.noreply.github.com> Date: Tue, 24 Oct 2023 03:25:09 +0200 Subject: [PATCH] style-guide: add guidelines for standard streams; fix remaining pages (#11196) * readonly, {un,}compress, zbarcam: use proper syntax for IO streams * style-guide: add guidelines for standard streams * duckdb, perl: add backticks around stdin and stdout --- contributing-guides/style-guide.md | 1 + pages/common/duckdb.md | 2 +- pages/common/perl.md | 2 +- pages/common/readonly.md | 2 +- pages/linux/compress.md | 2 +- pages/linux/uncompress.md | 4 ++-- pages/linux/zbarcam.md | 4 ++-- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/contributing-guides/style-guide.md b/contributing-guides/style-guide.md index c7a1bdbc0..f4e331d03 100644 --- a/contributing-guides/style-guide.md +++ b/contributing-guides/style-guide.md @@ -180,6 +180,7 @@ Use backticks on the following: - Paths, e.g. `package.json`, `/etc/package.json`. - Extensions, e.g. `.dll`. - Commands, e.g. `ls`. +- Standard streams: `stdout`, `stdin`, `stderr`. **Do not** use the full names (e.g. standard output). ## Descriptions diff --git a/pages/common/duckdb.md b/pages/common/duckdb.md index 4da3a9727..03e150fff 100644 --- a/pages/common/duckdb.md +++ b/pages/common/duckdb.md @@ -27,7 +27,7 @@ `duckdb {{path/to/dbfile}} -init {{path/to/script.sql}}` -- Read CSV from stdin and write CSV to stdout: +- Read CSV from `stdin` and write CSV to `stdout`: `cat {{path/to/source.csv}} | duckdb -c "{{COPY (FROM read_csv_auto('/dev/stdin')) TO '/dev/stdout' WITH (FORMAT CSV, HEADER)}}"` diff --git a/pages/common/perl.md b/pages/common/perl.md index 74128a242..8c4423c5d 100644 --- a/pages/common/perl.md +++ b/pages/common/perl.md @@ -3,7 +3,7 @@ > The Perl 5 language interpreter. > More information: . -- Print lines from stdin [m/] matching regex1 and case insensitive [/i] regex2: +- Print lines from `stdin` [m/] matching regex1 and case insensitive [/i] regex2: `perl -n -e 'print if m/{{regex1}}/ and m/{{regex2}}/i'` diff --git a/pages/common/readonly.md b/pages/common/readonly.md index d6aa2722a..9b66157f8 100644 --- a/pages/common/readonly.md +++ b/pages/common/readonly.md @@ -12,6 +12,6 @@ `readonly {{existing_variable}}` -- [p]rint to the standard output the names and values of all read-only variables: +- [p]rint the names and values of all read-only variables to `stdout`: `readonly -p` diff --git a/pages/linux/compress.md b/pages/linux/compress.md index 8e6d2fff1..2a6eecb18 100644 --- a/pages/linux/compress.md +++ b/pages/linux/compress.md @@ -15,7 +15,7 @@ `compress -b {{bits}}` -- Write to standard output (no files are changed): +- Write to `stdout` (no files are changed): `compress -c {{path/to/file}}` diff --git a/pages/linux/uncompress.md b/pages/linux/uncompress.md index 4eb1e368b..6760ff52a 100644 --- a/pages/linux/uncompress.md +++ b/pages/linux/uncompress.md @@ -11,10 +11,10 @@ `uncompress -f {{path/to/file1.Z path/to/file2.Z ...}}` -- Write to standard output (no files are changed and no `.Z` files are created): +- Write to `stdout` (no files are changed and no `.Z` files are created): `uncompress -c {{path/to/file1.Z path/to/file2.Z ...}}` -- Verbose mode (write to standard error about percentage reduction or expansion): +- Verbose mode (write to `stderr` about percentage reduction or expansion): `uncompress -v {{path/to/file1.Z path/to/file2.Z ...}}` diff --git a/pages/linux/zbarcam.md b/pages/linux/zbarcam.md index 787fe230e..1021328b6 100644 --- a/pages/linux/zbarcam.md +++ b/pages/linux/zbarcam.md @@ -1,9 +1,9 @@ # zbarcam -> Scans and decodes barcodes (and QR codes) from a video device. +> Scan and decode barcodes (and QR codes) from a video device. > More information: . -- Continuously read barcodes and print them to standard output: +- Continuously read barcodes and print them to `stdout`: `zbarcam`