Переглянути джерело

key export: move examples to docs

Thomas Waldmann 1 рік тому
батько
коміт
6211a3dc79
2 змінених файлів з 12 додано та 12 видалено
  1. 12 0
      docs/usage/key.rst
  2. 0 12
      src/borg/archiver/key_cmds.py

+ 12 - 0
docs/usage/key.rst

@@ -45,4 +45,16 @@ Fully automated using environment variables:
 
 
 .. include:: key_export.rst.inc
 .. include:: key_export.rst.inc
 
 
+Examples
+~~~~~~~~
+::
+
+    borg key export > encrypted-key-backup
+    borg key export --paper > encrypted-key-backup.txt
+    borg key export --qr-html > encrypted-key-backup.html
+    # Or pass the output file as an argument instead of redirecting stdout:
+    borg key export encrypted-key-backup
+    borg key export --paper encrypted-key-backup.txt
+    borg key export --qr-html encrypted-key-backup.html
+
 .. include:: key_import.rst.inc
 .. include:: key_import.rst.inc

+ 0 - 12
src/borg/archiver/key_cmds.py

@@ -160,18 +160,6 @@ class KeysMixIn:
         repository in the config file. A backup is thus not strictly needed,
         repository in the config file. A backup is thus not strictly needed,
         but guards against the repository becoming inaccessible if the file
         but guards against the repository becoming inaccessible if the file
         is damaged for some reason.
         is damaged for some reason.
-
-        Examples::
-
-            borg key export /path/to/repo > encrypted-key-backup
-            borg key export --paper /path/to/repo > encrypted-key-backup.txt
-            borg key export --qr-html /path/to/repo > encrypted-key-backup.html
-            # Or pass the output file as an argument instead of redirecting stdout:
-            borg key export /path/to/repo encrypted-key-backup
-            borg key export --paper /path/to/repo encrypted-key-backup.txt
-            borg key export --qr-html /path/to/repo encrypted-key-backup.html
-
-
         """
         """
         )
         )
         subparser = key_parsers.add_parser(
         subparser = key_parsers.add_parser(