def _node_parse_command_and_opt(**opts_dict):
    """Return 'command' and 'command_opt' from **opts_dict.


    Find which command has a non null attribute and returns it.

    >>> _node_parse_command_and_opt(firmware_path='/tmp/test',
    ...                             profile_name=None,
    ...                             profile_path=None,
    ...                             command='with_argument')
    ('flash', '/tmp/test')

    >>> _node_parse_command_and_opt(firmware_path=None,
    ...                             profile_name='consumption',
    ...                             profile_path=None,
    ...                             command='with_argument')
    ('profile', 'consumption')

    >>> _node_parse_command_and_opt(firmware_path=None,
    ...                             profile_name=None,
    ...                             profile_path='/tmp/prof.json',
    ...                             command='with_argument')
    ('profile-load', '/tmp/prof.json')

    # Case where the command is not managed
    >>> _node_parse_command_and_opt(firmware_path=None,
    ...                             profile_name=None,
    ...                             profile_path=None,
    ...                             command='with_argument')
    Traceback (most recent call last):
    ...
    ValueError: Unknown command
    """
    commands_arguments = {'flash': 'firmware_path', 'profile':
        'profile_name', 'profile-load': 'profile_path'}
    for command, argname in commands_arguments.items():
        cmd_opt = opts_dict.get(argname, None)
        if cmd_opt is not None:
            return command, cmd_opt
    raise ValueError('Unknown command')
