fish: Replace '_' with '-' in deprecation cross-refs (thanks Olaf Hering).

This commit is contained in:
Richard W.M. Jones
2012-09-13 19:31:51 +01:00
parent d9a98dc1cd
commit 8acdc23622
2 changed files with 5 additions and 3 deletions

View File

@@ -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.

View File

@@ -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