summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRoger Knecht <rknecht@pm.me>2022-09-03 11:34:53 +0000
committerTom Rini <trini@konsulko.com>2022-10-11 15:40:48 -0400
commit690a1d694899c55c7cc6a168c54984f765ff761e (patch)
tree0d1949060afcdda676a4a8e7bfc89053a391f1a4 /doc
parent7eda1a95331d1ccd17e5af6fb18bf5577f81a451 (diff)
cmd: cat: add new command
Add cat command to print file content to standard out Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Roger Knecht <rknecht@pm.me>
Diffstat (limited to 'doc')
-rw-r--r--doc/usage/cmd/cat.rst49
-rw-r--r--doc/usage/index.rst1
2 files changed, 50 insertions, 0 deletions
diff --git a/doc/usage/cmd/cat.rst b/doc/usage/cmd/cat.rst
new file mode 100644
index 0000000000..5ef4731fe3
--- /dev/null
+++ b/doc/usage/cmd/cat.rst
@@ -0,0 +1,49 @@
+.. SPDX-License-Identifier: GPL-2.0+:
+
+cat command
+===============
+
+Synopsis
+--------
+
+::
+
+ cat <interface> <dev[:part]> <file>
+
+Description
+-----------
+
+The cat command prints the file content to standard out.
+
+interface
+ interface for accessing the block device (mmc, sata, scsi, usb, ....)
+
+dev
+ device number
+
+part
+ partition number, defaults to 1
+
+file
+ path to file
+
+Example
+-------
+
+Here is the output for a example text file:
+
+::
+
+ => cat mmc 0:1 hello
+ hello world
+ =>
+
+Configuration
+-------------
+
+The cat command is only available if CONFIG_CMD_CAT=y.
+
+Return value
+------------
+
+The return value $? is set to 0 (true) if the file is readable, otherwise it returns a non-zero error code.
diff --git a/doc/usage/index.rst b/doc/usage/index.rst
index d0641105ae..a05aa42485 100644
--- a/doc/usage/index.rst
+++ b/doc/usage/index.rst
@@ -31,6 +31,7 @@ Shell commands
cmd/bootmeth
cmd/button
cmd/bootz
+ cmd/cat
cmd/cbsysinfo
cmd/cls
cmd/conitrace