Skip to content

Commit 97f987f

Browse files
committed
Cleanup console examples in docs
1 parent 9a7aa2e commit 97f987f

10 files changed

Lines changed: 45 additions & 37 deletions

File tree

dfetch/commands/diff.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
1616
The below statement will generate a patch for ``some-project`` from your manifest.
1717
18-
.. code-block:: sh
18+
.. code-block:: console
1919
20-
dfetch diff some-project
20+
$ dfetch diff some-project
2121
2222
.. tabs::
2323
@@ -41,15 +41,15 @@
4141
4242
.. tab:: Git
4343
44-
.. code-block:: sh
44+
.. code-block:: console
4545
46-
git apply --check formatted-some-project.patch
46+
$ git apply --check formatted-some-project.patch
4747
4848
.. tab:: SVN
4949
50-
.. code-block:: sh
50+
.. code-block:: console
5151
52-
svn patch formatted-some-project.patch
52+
$ svn patch formatted-some-project.patch
5353
5454
"""
5555

dfetch/commands/format_patch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
root directory. The ``format-patch`` command reformats all patches of a project
99
to make them usable for the upstream project.
1010
11-
.. code-block:: sh
11+
.. code-block:: console
1212
13-
dfetch format-patch some-project
13+
$ dfetch format-patch some-project
1414
1515
.. tabs::
1616

dfetch/commands/update_patch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
1616
The below statement will update the patch for ``some-project`` from your manifest.
1717
18-
.. code-block:: sh
18+
.. code-block:: console
1919
20-
dfetch update-patch some-project
20+
$ dfetch update-patch some-project
2121
2222
.. tabs::
2323

dfetch/manifest/project.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@
295295
296296
.. tab:: Git
297297
298-
.. code-block:: sh
298+
.. code-block:: console
299299
300-
git diff --relative=path/to/project HEAD > my_patch.patch
300+
$ git diff --relative=path/to/project HEAD > my_patch.patch
301301
302302
For more details see the `git-diff <https://git-scm.com/docs/git-diff>`_ documentation.
303303
@@ -307,9 +307,9 @@
307307
308308
.. tab:: SVN
309309
310-
.. code-block:: sh
310+
.. code-block:: console
311311
312-
svn diff -r HEAD path/to/my_project > my_patch.patch
312+
$ svn diff -r HEAD path/to/my_project > my_patch.patch
313313
314314
For more details see the `svn-diff <http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.diff.html>`_ documentation.
315315

doc/howto/adding-a-project.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ Pass the repository URL to ``dfetch add`` and it will append a new entry to
5757
(branches and tags), selects the default branch, and guesses a destination
5858
path based on your existing projects.
5959

60-
.. code-block:: sh
60+
.. code-block:: console
6161
6262
$ dfetch add https://github.com/some-org/some-repo.git
6363
6464
.. asciinema:: ../asciicasts/add.cast
6565

6666
Override individual fields with flags:
6767

68-
.. code-block:: sh
68+
.. code-block:: console
6969
7070
$ dfetch add \
7171
--name mylib \
@@ -86,7 +86,7 @@ The ``--interactive`` (``-i``) flag starts a step-by-step wizard. Use it
8686
when you want to browse available branches and tags, choose a sub-directory
8787
inside the remote repository, or configure which paths to ignore.
8888

89-
.. code-block:: sh
89+
.. code-block:: console
9090
9191
$ dfetch add -i https://github.com/some-org/some-repo.git
9292
@@ -106,7 +106,7 @@ The wizard walks through each field in turn:
106106

107107
You can pre-fill any field to skip its prompt:
108108

109-
.. code-block:: sh
109+
.. code-block:: console
110110
111111
$ dfetch add -i --version main \
112112
--src lib/core \

doc/howto/check-ci.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Running dfetch check in CI
2525
Without extra flags the results are printed to stdout and the build fails if
2626
any issue is found:
2727

28-
.. code-block:: sh
28+
.. code-block:: console
2929
30-
dfetch check
30+
$ dfetch check
3131
3232
Pass a ``--*-json`` flag to write a machine-readable report *and* continue
3333
collecting results before deciding the build outcome (each section below shows

doc/howto/patching.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ After fetching a project with :ref:`dfetch update <update>`, make your edits
2727
directly in the vendored source tree. Once you are happy with the changes,
2828
run:
2929

30-
.. code-block:: sh
30+
.. code-block:: console
3131
32-
dfetch diff some-project
32+
$ dfetch diff some-project
3333
3434
*Dfetch* compares the working tree against the revision recorded in the
3535
metadata file and writes a patch file named ``some-project.patch`` (or
@@ -86,9 +86,9 @@ As your local edits evolve — or when the upstream version changes — the
8686
existing patch file may no longer apply cleanly. Instead of manually
8787
regenerating it, run:
8888

89-
.. code-block:: sh
89+
.. code-block:: console
9090
91-
dfetch update-patch some-project
91+
$ dfetch update-patch some-project
9292
9393
This regenerates the last patch for ``some-project`` from the current working
9494
tree, keeping the upstream revision unchanged. It is safe to run repeatedly
@@ -116,9 +116,9 @@ directory inside your repository. Most upstream projects expect patches to be
116116
relative to their own root, which is a different path. To reformat all patches
117117
for a project:
118118

119-
.. code-block:: sh
119+
.. code-block:: console
120120
121-
dfetch format-patch some-project
121+
$ dfetch format-patch some-project
122122
123123
This writes a ``formatted-some-project.patch`` file (or one file per patch if
124124
there are several) that is ready to attach to a pull request or send by email.
@@ -130,15 +130,15 @@ You can verify the formatted patch applies cleanly before submitting:
130130

131131
.. tab:: Git
132132

133-
.. code-block:: sh
133+
.. code-block:: console
134134
135-
git apply --check formatted-some-project.patch
135+
$ git apply --check formatted-some-project.patch
136136
137137
.. tab:: SVN
138138

139-
.. code-block:: sh
139+
.. code-block:: console
140140
141-
svn patch formatted-some-project.patch
141+
$ svn patch formatted-some-project.patch
142142
143143
.. asciinema:: ../asciicasts/format-patch.cast
144144

doc/howto/sbom.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ license policy across an organisation.
1111

1212
.. asciinema:: ../asciicasts/sbom.cast
1313

14-
.. code-block:: sh
14+
.. code-block:: console
1515
1616
$ dfetch report -t sbom -o dfetch.cdx.json
1717

doc/howto/updating-projects.rst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Fetching all projects
2121

2222
Run without arguments to fetch every project in the manifest:
2323

24-
.. code-block:: sh
24+
.. code-block:: console
2525
2626
$ dfetch update
2727
@@ -53,10 +53,12 @@ Updating a single project
5353

5454
Pass one or more project names to limit which entries are updated:
5555

56-
.. code-block:: sh
56+
.. code-block:: console
5757
5858
$ dfetch update mylib
5959
60+
.. code-block:: console
61+
6062
$ dfetch update mylib myother
6163
6264
.. _updating-force:
@@ -68,7 +70,7 @@ By default *Dfetch* skips a project that is already at the requested version
6870
or that has local modifications. Use ``--force`` (``-f``) to re-fetch and
6971
overwrite regardless:
7072

71-
.. code-block:: sh
73+
.. code-block:: console
7274
7375
$ dfetch update --force mylib
7476
@@ -89,7 +91,7 @@ decide whether to vendor those as well.
8991

9092
To skip this check entirely:
9193

92-
.. code-block:: sh
94+
.. code-block:: console
9395
9496
$ dfetch update --no-recommendations
9597
@@ -105,7 +107,11 @@ automatically — no extra manifest entries or ``git submodule`` commands are
105107
needed. Each submodule is checked out at the exact revision pinned by the
106108
parent repository::
107109

108-
Dfetch (0.12.1)
110+
.. code-block:: console
111+
112+
$ dfetch update
113+
114+
Dfetch (0.13.0)
109115
my-project:
110116
> Found & fetched submodule "./ext/vendor-lib" (https://github.com/example/vendor-lib @ master - 79698c9…)
111117
> Fetched master - e1fda19…

doc/tutorials/getting_started.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ Make sure that you have installed *Dfetch* as described in :ref:`Installation`.
6262

6363
From a command-line perform the following command::
6464

65-
dfetch update
65+
.. code-block:: console
66+
67+
$ dfetch update
6668
6769
*Dfetch* will search through all directories down until it finds the ``dfetch.yaml``
6870
manifest and it will perform the update.

0 commit comments

Comments
 (0)