瀏覽代碼

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(