@cevich .Hmmm, I didn't try to check the output line if it's valid.My check is this.When you execute "virsh help <virsh command>".The output contains some parts of infomation.For example:
  NAME
    list - list domains

  SYNOPSIS
    list [--inactive] [--all] [--transient] [--persistent] [--uuid] [--name] [--table] [--managed-save] [--title]

  DESCRIPTION
    Returns list of domains.

  OPTIONS
    --inactive       list inactive domains
There are 4 parts infomation, titles are:NAME SYNOPSIS DESCRIPTION OPTIONS.Every line under title has some infomation.If not, the check will fail.
So, first step I find the title with "regx = re.compile(r"^\s*[A-Z]*\s*$")" since the title are capital letters.
Then check the line under title has infomation or not. If not the check fails.
For example :
[root@bogon virt]# virsh help iface-begin
  NAME
    iface-begin - create a snapshot of current interfaces settings, which can be later committed (iface-commit) or restored (iface-rollback)

  SYNOPSIS
    iface-begin

  DESCRIPTION
    Create a restore point for interfaces settings

  OPTIONS

The "OPTIONS" has no infomation under title, so the check failed.