[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH libnbd v2 1/5] generator: Avoid over-long lines in POD.



If there are too many states in the permitted_states list then it
would cause over-long lines in POD which podwrapper objected to.
---
 generator/C.ml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/generator/C.ml b/generator/C.ml
index fe8eafc..3e9975f 100644
--- a/generator/C.ml
+++ b/generator/C.ml
@@ -416,10 +416,10 @@ let generate_lib_unlocked_h () =
   pr "\n";
   pr "#endif /* LIBNBD_UNLOCKED_H */\n"
 
-let permitted_state_text permitted_states =
+let permitted_state_text ?(fold=false) permitted_states =
   assert (permitted_states <> []);
-  String.concat
-    ", or "
+  let sep = if fold then ", or\n" else ", or " in
+  String.concat sep
     (List.map (
          function
          | Created -> "newly created"
@@ -913,7 +913,7 @@ let generate_docs_nbd_pod name { args; optargs; ret;
     pr "=head1 HANDLE STATE\n";
     pr "\n";
     pr "The handle must be\n";
-    pr "%s,\n" (permitted_state_text permitted_states);
+    pr "%s,\n" (permitted_state_text ~fold:true permitted_states);
     pr "otherwise this call will return an error.\n";
     pr "\n"
   );
-- 
2.29.0.rc2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]