summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-09-13 19:31:51 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-09-13 19:32:47 +0100
commit8acdc23622ea95a233ac831d67c143517aa94bba (patch)
treec3f1840258b4ff6d2290f93be5198bc8df294b13 /generator
parentd9a98dc1cdcfb185e659c0d02f74ae6739b340db (diff)
downloadlibguestfs-8acdc23622ea95a233ac831d67c143517aa94bba.tar.gz
libguestfs-8acdc23622ea95a233ac831d67c143517aa94bba.tar.xz
libguestfs-8acdc23622ea95a233ac831d67c143517aa94bba.zip
fish: Replace '_' with '-' in deprecation cross-refs (thanks Olaf Hering).
Diffstat (limited to 'generator')
-rw-r--r--generator/docstrings.ml4
-rw-r--r--generator/fish.ml4
2 files changed, 5 insertions, 3 deletions
diff --git a/generator/docstrings.ml b/generator/docstrings.ml
index d7d00012..3faaa57c 100644
--- a/generator/docstrings.ml
+++ b/generator/docstrings.ml
@@ -36,10 +36,12 @@ let protocol_limit_warning =
"Because of the message protocol, there is a transfer limit
of somewhere between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
-let deprecation_notice ?(prefix = "") =
+let deprecation_notice ?(prefix = "") ?(replace_underscores = false) =
function
| { deprecated_by = None } -> None
| { deprecated_by = Some alt } ->
+ let alt =
+ if replace_underscores then replace_char alt '_' '-' else alt in
let txt =
sprintf "I<This function is deprecated.>
In new code, use the L</%s%s> call instead.
diff --git a/generator/fish.ml b/generator/fish.ml
index e8ab91f4..76377a24 100644
--- a/generator/fish.ml
+++ b/generator/fish.ml
@@ -151,7 +151,7 @@ Guestfish will prompt for these separately."
let warnings =
warnings ^
- match deprecation_notice f with
+ match deprecation_notice ~replace_underscores:true f with
| None -> ""
| Some txt -> "\n\n" ^ txt in
@@ -891,7 +891,7 @@ Guestfish will prompt for these separately.\n\n";
if f.protocol_limit_warning then
pr "%s\n\n" protocol_limit_warning;
- match deprecation_notice f with
+ match deprecation_notice ~replace_underscores:true f with
| None -> ()
| Some txt -> pr "%s\n\n" txt
) all_functions_sorted