code: def test_cmdoption(app):
      text = ".. program:: ls\n" "\n" ".. option:: -l\n"
      domain = app.env.get_domain("std")
      doctree = restructuredtext.parse(app, text)
      assert_node(
          doctree,
          (
              addnodes.index,
              [
                  desc,
                  (
                      [
                          desc_signature,
                          ([desc_name, "-l"], [desc_addname, ()]),
                      ],
                      [desc_content, ()],
                  ),
              ],
          ),
      )
      assert_node(
          doctree[0],
          addnodes.index,
          entries=[
              (
                  "pair",
                  "ls command line option; -l",
                  "cmdoption-ls-l",
                  "",
                  None,
              )
          ],
      )
      assert ("ls", "-l") in domain.progoptions
      assert domain.progoptions[("ls", "-l")] == (
          "index",
          "cmdoption-ls-l",
      )
  
imports: from unittest import mock
  import pytest
  from docutils import nodes
  from docutils.nodes import definition, definition_list, definition_list_item, term
  from html5lib import HTMLParser
  from sphinx import addnodes
  from sphinx.addnodes import desc, desc_addname, desc_content, desc_name, desc_signature, glossary, index, pending_xref
  from sphinx.domains.std import StandardDomain
  from sphinx.testing import restructuredtext
  from sphinx.testing.util import assert_node
label_desc: Use image node_id 13 for calling a global function with example usage: test_cmdoption(app) without return types