<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def var_cmd():
 """Print a list of available variables. See :mod:`stagpy.phyvars` where the lists of variables organized by command are defined. """

    print_all = not any(val for _, val in conf.var.opt_vals_())
    if print_all or conf.var.field:
        print('field:')
        _layout(phyvars.FIELD, phyvars.FIELD_EXTRA)
        print()
    if print_all or conf.var.sfield:
        print('surface field:')
        _layout(phyvars.SFIELD, {})
        print()
    if print_all or conf.var.rprof:
        print('rprof:')
        _layout(phyvars.RPROF, phyvars.RPROF_EXTRA)
        print()
    if print_all or conf.var.time:
        print('time:')
        _layout(phyvars.TIME, phyvars.TIME_EXTRA)
        print()
    if print_all or conf.var.plates:
        print('plates:')
        _layout(phyvars.PLATES, {})