Skip to content

Commit d6248fd

Browse files
authored
Update fs CLI docs (#787)
1 parent b733ef2 commit d6248fd

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed

docs/sections/user_guide/cli/tools/fs.rst

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The ``uw`` mode for handling filesystem items (files and directories).
2121

2222
The ``copy`` action stages files in a target directory by copying files. Any ``KEY`` positional arguments are used to navigate, in the order given, from the top of the config to the :ref:`file block <files_yaml>`.
2323

24-
Source paths prefixed with ``http://``, ``https://``, or ``hsi://`` will be copied from their upstream network locations to the local filesystem.
24+
Source paths prefixed with ``http://``, ``https://``, ``hsi://``, or ``htar://`` will be copied from their upstream network locations to the local filesystem.
2525

2626
.. literalinclude:: fs/copy-help.cmd
2727
:language: text
@@ -32,7 +32,15 @@ Source paths prefixed with ``http://``, ``https://``, or ``hsi://`` will be copi
3232
Local-filesystem and HTTP Sources
3333
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3434

35-
Given a config containing a mapping from local-filesystem destination paths to source paths:
35+
Consider this source directory
36+
37+
.. literalinclude:: fs/srctree.cmd
38+
:language: text
39+
:emphasize-lines: 1
40+
.. literalinclude:: fs/srctree.out
41+
:language: text
42+
43+
and a config mapping local-filesystem destination paths to source paths:
3644

3745
.. literalinclude:: fs/copy.yaml
3846
:language: yaml
@@ -42,7 +50,7 @@ Given a config containing a mapping from local-filesystem destination paths to s
4250
.. literalinclude:: fs/copy.out
4351
:language: text
4452

45-
Here, ``foo`` and ``bar`` are copies of their respective local-filesystem source files, and ``gpl`` is a copy of the upstream network source.
53+
Here, ``foo`` and ``bar`` are copies of their respective local-filesystem source files, and the ``uwtools`` license file is a copy of the upstream network source.
4654

4755
The ``--cycle`` and ``--leadtime`` options can be used to make Python ``datetime`` and ``timedelta`` objects, respectively, available for use in Jinja2 expression in the config. For example:
4856

@@ -74,7 +82,7 @@ When the ``--report`` option is specified, a report of files not copied ("not-re
7482
.. literalinclude:: fs/copy-report.out
7583
:language: text
7684

77-
Since ``uwtools`` logs to ``stderr``, log and report output can be separated and the latter processed with a tool like ``jq``:
85+
Since ``uwtools`` logs to ``stderr``, log and report output can be separated and the latter processed with a tool like ``jq``, for example for extracting values for use elsewhere:
7886

7987
.. literalinclude:: fs/copy-report-jq.cmd
8088
:language: text
@@ -109,16 +117,20 @@ The examples in this section use the following files
109117

110118
.. literalinclude:: fs/copy-hpss-show-files.txt
111119
:language: text
120+
:emphasize-lines: 1
112121
.. literalinclude:: fs/copy-hpss-show-files.out
113122
:language: text
114123

115124
with this content:
116125

117126
.. literalinclude:: fs/copy-hpss-show-content.txt
118127
:language: text
128+
:emphasize-lines: 1-2
119129
.. literalinclude:: fs/copy-hpss-show-content.out
120130
:language: text
121131

132+
They also assume that the ``hsi`` and ``htar`` executable programs are available on ``PATH``.
133+
122134
**HSI Support**
123135

124136
An ``hsi://`` URL can be used as a source path to copy full files from HPSS to the local filesystem:
@@ -133,7 +145,7 @@ An ``hsi://`` URL can be used as a source path to copy full files from HPSS to t
133145

134146
See :ref:`files_yaml_hsi_support` for more information on UW YAML support for ``hsi://`` sources.
135147

136-
Use the ``!glob`` tag to copy multiple full HPSS files:
148+
Use the ``!glob`` tag to copy multiple full HPSS files. Here, ``<f>`` is a placeholder for the actual name of each glob-matched file.
137149

138150
.. literalinclude:: fs/copy-hpss-hsi-glob.yaml
139151
:language: yaml
@@ -159,7 +171,7 @@ An ``htar://`` URL can be used as a source path to extract a member from an HPSS
159171

160172
See :ref:`files_yaml_htar_support` for more information on UW YAML support for ``htar://`` sources.
161173

162-
Use the ``!glob`` tag to extract multiple members from one or more HPSS archive files:
174+
Use the ``!glob`` tag to extract multiple members from one or more HPSS archive files. Here, ``<f>`` is a placeholder for the actual name of each glob-matched file.
163175

164176
.. literalinclude:: fs/copy-hpss-htar-glob.yaml
165177
:language: yaml
@@ -176,7 +188,12 @@ See :ref:`files_yaml_htar_glob_support` for more information on the use of the `
176188

177189
The ``hardlink`` action stages items in a target directory by creating hardlinks to files or other links. It behaves similarly to the ``link`` action (see below), but note the following:
178190

179-
* Hardlinks cannot target: items on other filesystems, items the user does not have write permission to, or directories.
191+
* Hardlinks cannot target:
192+
193+
* Items on other filesystems
194+
* Items the user does not have write permission to
195+
* Directories
196+
180197
* If a hardlink cannot be created but the ``--symlink-fallback`` option is specified, a symlink will be created instead, if possible.
181198

182199
.. literalinclude:: fs/hardlink-help.cmd
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tree src
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
src
2+
├── 20240529
3+
│   └── 12
4+
│   └── 006
5+
│   └── baz
6+
├── bar
7+
└── foo
8+
9+
4 directories, 3 files

0 commit comments

Comments
 (0)