def cmd(binary, subcommand, *args, **kwargs):
    """
    Construct a command line for a "modern UNIX" command.

    Modern UNIX command do a closely-related-set-of-things and do it well.
    Examples include :code:`apt-get` or :code:`git`.

    :param binary: the name of the command
    :param subcommand: the subcommand used
    :param args: positional arguments (put last)
    :param kwargs: options
    :returns: list of arguments that is suitable to be passed to :code:`subprocess.Popen`
              and friends.

    When specifying options, the following assumptions are made:

    * Option names begin with :code:`--` and any :code:`_` is assumed to be a :code:`-`
    * If the value is :code:`NO_VALUE`, this is a "naked" option.
    * If the value is a string or an int, these are presented as the value of the option.
    * If the value is a list, the option will be repeated multiple times.
    * If the value is a dict, the option will be repeated multiple times, and
      its values will be :code:`<KEY>=<VALUE>`.
    """
    ret = [binary, subcommand]
    for key, value in kwargs.items():
        key = '--' + key.replace('_', '-')
        ret.extend(_keyword_arguments(value, key))
    ret.extend(args)
    return ret
Construct a command line for a "modern UNIX" command.

    Modern UNIX command do a closely-related-set-of-things and do it well.
    Examples include :code:`apt-get` or :code:`git`.

    :param binary: the name of the command
    :param subcommand: the subcommand used
    :param args: positional arguments (put last)
    :param kwargs: options
    :returns: list of arguments that is suitable to be passed to :code:`subprocess.Popen`
              and friends.

    When specifying options, the following assumptions are made:

    * Option names begin with :code:`--` and any :code:`_` is assumed to be a :code:`-`
    * If the value is :code:`NO_VALUE`, this is a "naked" option.
    * If the value is a string or an int, these are presented as the value of the option.
    * If the value is a list, the option will be repeated multiple times.
    * If the value is a dict, the option will be repeated multiple times, and
      its values will be :code:`<KEY>=<VALUE>`.