

def test_command_with_options_doc_and_subcommand_with_option_and_doc(self):
    child = commands.Command()
    child.help = 'some text about this sub-command.'
    child.add_argument('--test', help='the great and wonderful')
    cmd = commands.Command()
    child.help = 'some text about everything this command does.'
    cmd.add_argument('-h', '--help', action='store_true', help='show this message')
    cmd.add_child('bar', child)
    expected = 'usage: foo [-h]\n\nsome text about everything this command does.\n\nOPTIONS:\n\n  -h, --help  show this message\n\nCOMMANDS:\n\nbar [--test TEST]\n\n  some text about this sub-command.\n\n    --test TEST  the great and wonderful'
    self.assertEqual(expected, cmd.format_help('foo').strip())

dataset/ETHPy150Open mopidy/mopidy/tests/test_commands.py HelpTest.test_command_with_options_doc_and_subcommand_with_option_and_doc/VarMisuse@43/80 `cmd`->`child`