Bug 523970

Summary: DOCS: List of virsh commands is not sorted in alphabetical order
Product: [Community] Virtualization Tools Reporter: Jan Stodola <jstodola>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: berrange, clalance, crobinso, itamar, jclift, jtomko, veillard, virt-maint, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.8.7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-16 10:31:35 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
virsh -h none

Description Jan Stodola 2009-09-17 08:54:33 EDT
Created attachment 361493 [details]
virsh -h

Description of problem:
List of commands in virsh help should be listed in alphabetical order - most of the commands are already listed in alphabetical order, but some of them are not (help, start, iface*, secret*, dump and so forth).

Version-Release number of selected component (if applicable):
libvirt-client-0.7.1-1.fc12.x86_64

How reproducible:
always

Steps to Reproduce:
1. run virsh -h
  
Actual results:
not all listed commands are sorted in alphabetical order
(for example command "dump" is between commands "schedinfo" and "shutdown"
)

Expected results:
all commands listed in alphabetical order
Comment 1 Mark McLoughlin 2009-09-17 09:21:35 EDT
Good point, they're almost alphabetical but not quite

Moving this one upstream

Might be a nice opportunity to cook up a simple patch :-)

Thanks for the report
Comment 2 Ján Tomko 2015-03-16 10:31:35 EDT
Fixed by:
commit 7829052757953023b0826e0293ffe18ed4ab89e9
Author:     Osier Yang <jyang@redhat.com>
AuthorDate: 2010-11-30 14:37:04 +0800
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: 2010-11-30 13:35:32 -0700

    virsh: Categorize commands into groups for virsh help
    
    Change the virsh help out. The new output of "virsh help" and
    "virsh --help" will be like:
    
     Secret (help keyword 'secret'):
        secret-define                  define or modify a secret from an XML file
        secret-dumpxml                 secret attributes in XML
        secret-set-value               set a secret value
        secret-get-value               Output a secret value
        secret-undefine                undefine a secret
        secret-list                    list secrets
    
     Snapshot (help keyword 'snapshot'):
        snapshot-create                Create a snapshot
        snapshot-current               Get the current snapshot
        snapshot-delete                Delete a domain snapshot
        snapshot-dumpxml               Dump XML for a domain snapshot
        snapshot-list                  List snapshots for a domain
        snapshot-revert                Revert a domain to a snapshot
    
    Also support output help information of specified command group, e.g.
    
    % ./tools/virsh help "Network Filter"
     Network Filter (help keyword 'filter'):
        nwfilter-define                define or update a network filter from an XML file
        nwfilter-undefine              undefine a network filter
        nwfilter-dumpxml               network filter information in XML
        nwfilter-list                  list network filters
        nwfilter-edit                  edit XML configuration for a network filter
    
    Each group has a help keyword, e.g.
    
    % ./tools/virsh help filter
     Network Filter (help keyword 'filter'):
        nwfilter-define                define or update a network filter from an XML file
        nwfilter-undefine              undefine a network filter
        nwfilter-dumpxml               network filter information in XML
        nwfilter-list                  list network filters
        nwfilter-edit                  edit XML configuration for a network filter
    
    * tools/virsh.c:
      - introduce new struct "vshCmdGrp" and macros to define the groups.
      - split previous array "commands" into small arrays which are orgnized
        by group
      - changed some functions, e.g. "vshCmdDefSearch"
      - Added new functions, e.g. "vshCmdGrpSearch"
      - commands of each group are in "alphabetical order" now.
      - command groups are in "alphabetical order" now.
      - the commands are categorized with reference of
        http://wiki.libvirt.org/page/VirshHelpV2 (by Justin)
      - the modifications doesn't affect tests
    
    * TODO:
      - doc

git describe: v0.8.6-2-g7829052 contains: v0.8.7~198