Przeglądaj źródła

docs: usage: avoid bash highlight, [options] instead of <options>

Marian Beermann 8 lat temu
rodzic
commit
13adc80cde

+ 2 - 2
docs/usage/benchmark_crud.rst.inc

@@ -4,9 +4,9 @@
 
 borg benchmark crud
 -------------------
-::
+.. code-block:: none
 
-    borg [common options] benchmark crud <options> REPO PATH
+    borg [common options] benchmark crud [options] REPO PATH
 
 positional arguments
     REPO

+ 2 - 2
docs/usage/break-lock.rst.inc

@@ -4,9 +4,9 @@
 
 borg break-lock
 ---------------
-::
+.. code-block:: none
 
-    borg [common options] break-lock <options> REPOSITORY
+    borg [common options] break-lock [options] REPOSITORY
 
 positional arguments
     REPOSITORY

+ 2 - 2
docs/usage/change-passphrase.rst.inc

@@ -4,9 +4,9 @@
 
 borg change-passphrase
 ----------------------
-::
+.. code-block:: none
 
-    borg [common options] change-passphrase <options> REPOSITORY
+    borg [common options] change-passphrase [options] REPOSITORY
 
 positional arguments
     REPOSITORY

+ 2 - 2
docs/usage/check.rst.inc

@@ -4,9 +4,9 @@
 
 borg check
 ----------
-::
+.. code-block:: none
 
-    borg [common options] check <options> REPOSITORY_OR_ARCHIVE
+    borg [common options] check [options] REPOSITORY_OR_ARCHIVE
 
 positional arguments
     REPOSITORY_OR_ARCHIVE

+ 2 - 2
docs/usage/create.rst.inc

@@ -4,9 +4,9 @@
 
 borg create
 -----------
-::
+.. code-block:: none
 
-    borg [common options] create <options> ARCHIVE PATH
+    borg [common options] create [options] ARCHIVE PATH
 
 positional arguments
     ARCHIVE

+ 2 - 2
docs/usage/delete.rst.inc

@@ -4,9 +4,9 @@
 
 borg delete
 -----------
-::
+.. code-block:: none
 
-    borg [common options] delete <options> TARGET
+    borg [common options] delete [options] TARGET
 
 positional arguments
     TARGET

+ 2 - 2
docs/usage/diff.rst.inc

@@ -4,9 +4,9 @@
 
 borg diff
 ---------
-::
+.. code-block:: none
 
-    borg [common options] diff <options> REPO_ARCHIVE1 ARCHIVE2 PATH
+    borg [common options] diff [options] REPO_ARCHIVE1 ARCHIVE2 PATH
 
 positional arguments
     REPO_ARCHIVE1

+ 2 - 2
docs/usage/export-tar.rst.inc

@@ -4,9 +4,9 @@
 
 borg export-tar
 ---------------
-::
+.. code-block:: none
 
-    borg [common options] export-tar <options> ARCHIVE FILE PATH
+    borg [common options] export-tar [options] ARCHIVE FILE PATH
 
 positional arguments
     ARCHIVE

+ 2 - 2
docs/usage/extract.rst.inc

@@ -4,9 +4,9 @@
 
 borg extract
 ------------
-::
+.. code-block:: none
 
-    borg [common options] extract <options> ARCHIVE PATH
+    borg [common options] extract [options] ARCHIVE PATH
 
 positional arguments
     ARCHIVE

+ 2 - 2
docs/usage/info.rst.inc

@@ -4,9 +4,9 @@
 
 borg info
 ---------
-::
+.. code-block:: none
 
-    borg [common options] info <options> REPOSITORY_OR_ARCHIVE
+    borg [common options] info [options] REPOSITORY_OR_ARCHIVE
 
 positional arguments
     REPOSITORY_OR_ARCHIVE

+ 2 - 2
docs/usage/init.rst.inc

@@ -4,9 +4,9 @@
 
 borg init
 ---------
-::
+.. code-block:: none
 
-    borg [common options] init <options> REPOSITORY
+    borg [common options] init [options] REPOSITORY
 
 positional arguments
     REPOSITORY

+ 2 - 2
docs/usage/key_change-passphrase.rst.inc

@@ -4,9 +4,9 @@
 
 borg key change-passphrase
 --------------------------
-::
+.. code-block:: none
 
-    borg [common options] key change-passphrase <options> REPOSITORY
+    borg [common options] key change-passphrase [options] REPOSITORY
 
 positional arguments
     REPOSITORY

+ 2 - 2
docs/usage/key_export.rst.inc

@@ -4,9 +4,9 @@
 
 borg key export
 ---------------
-::
+.. code-block:: none
 
-    borg [common options] key export <options> REPOSITORY PATH
+    borg [common options] key export [options] REPOSITORY PATH
 
 positional arguments
     REPOSITORY

+ 2 - 2
docs/usage/key_import.rst.inc

@@ -4,9 +4,9 @@
 
 borg key import
 ---------------
-::
+.. code-block:: none
 
-    borg [common options] key import <options> REPOSITORY PATH
+    borg [common options] key import [options] REPOSITORY PATH
 
 positional arguments
     REPOSITORY

+ 2 - 2
docs/usage/key_migrate-to-repokey.rst.inc

@@ -4,9 +4,9 @@
 
 borg key migrate-to-repokey
 ---------------------------
-::
+.. code-block:: none
 
-    borg [common options] key migrate-to-repokey <options> REPOSITORY
+    borg [common options] key migrate-to-repokey [options] REPOSITORY
 
 positional arguments
     REPOSITORY

+ 2 - 2
docs/usage/list.rst.inc

@@ -4,9 +4,9 @@
 
 borg list
 ---------
-::
+.. code-block:: none
 
-    borg [common options] list <options> REPOSITORY_OR_ARCHIVE PATH
+    borg [common options] list [options] REPOSITORY_OR_ARCHIVE PATH
 
 positional arguments
     REPOSITORY_OR_ARCHIVE

+ 2 - 2
docs/usage/mount.rst.inc

@@ -4,9 +4,9 @@
 
 borg mount
 ----------
-::
+.. code-block:: none
 
-    borg [common options] mount <options> REPOSITORY_OR_ARCHIVE MOUNTPOINT
+    borg [common options] mount [options] REPOSITORY_OR_ARCHIVE MOUNTPOINT
 
 positional arguments
     REPOSITORY_OR_ARCHIVE

+ 2 - 2
docs/usage/prune.rst.inc

@@ -4,9 +4,9 @@
 
 borg prune
 ----------
-::
+.. code-block:: none
 
-    borg [common options] prune <options> REPOSITORY
+    borg [common options] prune [options] REPOSITORY
 
 positional arguments
     REPOSITORY

+ 2 - 2
docs/usage/recreate.rst.inc

@@ -4,9 +4,9 @@
 
 borg recreate
 -------------
-::
+.. code-block:: none
 
-    borg [common options] recreate <options> REPOSITORY_OR_ARCHIVE PATH
+    borg [common options] recreate [options] REPOSITORY_OR_ARCHIVE PATH
 
 positional arguments
     REPOSITORY_OR_ARCHIVE

+ 2 - 2
docs/usage/rename.rst.inc

@@ -4,9 +4,9 @@
 
 borg rename
 -----------
-::
+.. code-block:: none
 
-    borg [common options] rename <options> ARCHIVE NEWNAME
+    borg [common options] rename [options] ARCHIVE NEWNAME
 
 positional arguments
     ARCHIVE

+ 2 - 2
docs/usage/serve.rst.inc

@@ -4,9 +4,9 @@
 
 borg serve
 ----------
-::
+.. code-block:: none
 
-    borg [common options] serve <options>
+    borg [common options] serve [options]
 
 optional arguments
     ``--restrict-to-path PATH``

+ 2 - 2
docs/usage/umount.rst.inc

@@ -4,9 +4,9 @@
 
 borg umount
 -----------
-::
+.. code-block:: none
 
-    borg [common options] umount <options> MOUNTPOINT
+    borg [common options] umount [options] MOUNTPOINT
 
 positional arguments
     MOUNTPOINT

+ 2 - 2
docs/usage/upgrade.rst.inc

@@ -4,9 +4,9 @@
 
 borg upgrade
 ------------
-::
+.. code-block:: none
 
-    borg [common options] upgrade <options> REPOSITORY
+    borg [common options] upgrade [options] REPOSITORY
 
 positional arguments
     REPOSITORY

+ 2 - 2
docs/usage/with-lock.rst.inc

@@ -4,9 +4,9 @@
 
 borg with-lock
 --------------
-::
+.. code-block:: none
 
-    borg [common options] with-lock <options> REPOSITORY COMMAND ARGS
+    borg [common options] with-lock [options] REPOSITORY COMMAND ARGS
 
 positional arguments
     REPOSITORY

+ 2 - 2
setup.py

@@ -261,7 +261,7 @@ class build_usage(Command):
                               "command_": command.replace(' ', '_'),
                               "underline": '-' * len('borg ' + command)}
                     doc.write(".. _borg_{command_}:\n\n".format(**params))
-                    doc.write("borg {command}\n{underline}\n::\n\n    borg [common options] {command}".format(**params))
+                    doc.write("borg {command}\n{underline}\n.. code-block:: none\n\n    borg [common options] {command}".format(**params))
                     self.write_usage(parser, doc)
                     epilog = parser.epilog
                     parser.epilog = None
@@ -278,7 +278,7 @@ class build_usage(Command):
 
     def write_usage(self, parser, fp):
         if any(len(o.option_strings) for o in parser._actions):
-            fp.write(' <options>')
+            fp.write(' [options]')
         for option in parser._actions:
             if option.option_strings:
                 continue