Combined binary.
[virt-mem.git] / dmesg / virt_dmesg.ml
index 10d231f..0931e91 100644 (file)
@@ -23,20 +23,7 @@ open Virt_mem_gettext.Gettext
 open Virt_mem_utils
 open Virt_mem_mmap
 
-let usage = s_"NAME
-  virt-dmesg - dmesg command for virtual machines
-
-SUMMARY
-  virt-dmesg [-options] [domains]
-
-DESCRIPTION
-  virt-dmesg prints the kernel messages for virtual machines running
-  under libvirt.  The output is similar to the ordinary dmesg command
-  run inside the virtual machine."
-
-let verbose, images = Virt_mem.start usage
-
-let () =
+let run debug images =
   List.iter (
     fun (name, arch, mem, lookup_ksym) ->
       try
@@ -86,3 +73,11 @@ let () =
          eprintf (f_"%s: could not find kernel log buffer in kernel image\n")
            name
   ) images
+
+let summary = s_"display kernel messages"
+let description = s_"\
+virt-dmesg prints the kernel messages for virtual machines running
+under libvirt.  The output is similar to the ordinary dmesg command
+run inside the virtual machine."
+
+let () = Virt_mem.register "dmesg" summary description true run