From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhigang Wang Subject: Re: [PATCHv2] xl: use help table to describe command help information Date: Tue, 11 May 2010 10:59:00 +0800 Message-ID: <4BE8C7F4.30305@oracle.com> References: <4BE7B0E3.5030604@cn.fujitsu.com> <4BE7B173.6000806@cn.fujitsu.com> <4BE7B64D.9070804@ts.fujitsu.com> <4BE8BE70.8080602@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4BE8BE70.8080602@cn.fujitsu.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Wei Yongjun Cc: Juergen Gross , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Excellent! It's the right design. Thanks, zhigang On 05/11/2010 10:18 AM, Wei Yongjun wrote: > # HG changeset patch > # User Wei Yongjun > # Date 1273544009 -28800 > # Node ID 3b082b6199edbe1af1c61c778d44028c499e5320 > # Parent f8f668ad3841f7596c5085546961d9c7acf53ace > xl: use help table to describe command help information > > This patch generate a help table to describe command help > information. > > Signed-off-by: Wei Yongjun > > diff -r f8f668ad3841 -r 3b082b6199ed tools/libxl/xl_cmdimpl.c > --- a/tools/libxl/xl_cmdimpl.c Mon May 10 14:50:48 2010 +0800 > +++ b/tools/libxl/xl_cmdimpl.c Tue May 11 10:13:29 2010 +0800 > @@ -1164,111 +1164,16 @@ > for (i = 0; i < cmdtable_len; i++) > printf(" %-20s%s\n", > cmd_table[i].cmd_name, cmd_table[i].cmd_desc); > - } else if(!strcmp(command, "create")) { > - printf("Usage: xl create [options] [vars]\n\n"); > - printf("Create a domain based on .\n\n"); > - printf("Options:\n\n"); > - printf("-h Print this help.\n"); > - printf("-p Leave the domain paused after it is created.\n"); > - printf("-c Connect to the console after the domain is created.\n"); > - printf("-d Enable debug messages.\n"); > - printf("-e Do not wait in the background for the death of the domain.\n"); > - } else if(!strcmp(command, "list")) { > - printf("Usage: xl list [-v] [Domain]\n\n"); > - printf("List information about all/some domains.\n\n"); > - } else if(!strcmp(command, "pci-attach")) { > - printf("Usage: xl pci-attach [Virtual Slot]\n\n"); > - printf("Insert a new pass-through pci device.\n\n"); > - } else if(!strcmp(command, "pci-detach")) { > - printf("Usage: xl pci-detach \n\n"); > - printf("Remove a domain's pass-through pci device.\n\n"); > - } else if(!strcmp(command, "pci-list")) { > - printf("Usage: xl pci-list \n\n"); > - printf("List pass-through pci devices for a domain.\n\n"); > - } else if(!strcmp(command, "pause")) { > - printf("Usage: xl pause \n\n"); > - printf("Pause execution of a domain.\n\n"); > - } else if(!strcmp(command, "unpause")) { > - printf("Usage: xl unpause \n\n"); > - printf("Unpause a paused domain.\n\n"); > - } else if(!strcmp(command, "save")) { > - printf("Usage: xl save [options] []\n\n"); > - printf("Save a domain state to restore later.\n\n"); > - printf("Options:\n\n"); > - printf("-h Print this help.\n"); > - printf("-c Leave domain running after creating the snapshot.\n"); > - } else if(!strcmp(command, "restore")) { > - printf("Usage: xl restore [options] [] \n\n"); > - printf("Restore a domain from a saved state.\n\n"); > - printf("Options:\n\n"); > - printf("-h Print this help.\n"); > - printf("-p Do not unpause domain after restoring it.\n"); > - printf("-e Do not wait in the background for the death of the domain.\n"); > - printf("-d Enable debug messages.\n"); > - } else if(!strcmp(command, "migrate")) { > - printf("Usage: xl migrate [options] \n\n"); > - printf("Save a domain state to restore later.\n\n"); > - printf("Options:\n\n"); > - printf("-h Print this help.\n"); > - printf("-C Send instead of config file from creation.\n"); > - printf("-s Use instead of ssh. String will be passed to sh. If empty, run instead of ssh xl migrate-receive [-d -e]\n"); > - printf("-e Do not wait in the background (on ) for the death of the domain.\n"); > - } else if(!strcmp(command, "migrate-receive")) { > - printf("Usage: xl migrate-receive - for internal use only"); > - } else if(!strcmp(command, "restore")) { > - printf("Usage: xl restore [options] [] \n\n"); > - printf("Restore a domain from a saved state.\n\n"); > - printf("Options:\n\n"); > - printf("-h Print this help.\n"); > - printf("-O Old (configless) xl save format.\n"); > - printf("-p Do not unpause domain after restoring it.\n"); > - printf("-e Do not wait in the background for the death of the domain.\n"); > - } else if(!strcmp(command, "destroy")) { > - printf("Usage: xl destroy \n\n"); > - printf("Terminate a domain immediately.\n\n"); > - } else if (!strcmp(command, "console")) { > - printf("Usage: xl console \n\n"); > - printf("Attach to domain's console.\n\n"); > - } else if (!strcmp(command, "cd-insert")) { > - printf("Usage: xl cd-insert \n\n"); > - printf("Insert a cdrom into a guest's cd drive.\n\n"); > - } else if (!strcmp(command, "cd-eject")) { > - printf("Usage: xl cd-eject \n\n"); > - printf("Eject a cdrom from a guest's cd drive.\n\n"); > - } else if (!strcmp(command, "mem-set")) { > - printf("Usage: xl mem-set \n\n"); > - printf("Set the current memory usage for a domain.\n\n"); > - } else if (!strcmp(command, "button-press")) { > - printf("Usage: xl button-press