
# a wrapper of odutil to control opendirectoryd

xrc:mod:lib     mac     _pref/od/config   _pref/od/stat _pref/od/cache

___x_cmd_mac_od(){
    [ $# -gt 0 ]    ||      set -- all

    local op="$1";  shift
    case "$op" in
        -h|--help)          ___x_cmd help -m mac od         "$@" ;;

        c|config)           ___x_cmd_mac_od_report          "$@" ;;
        s|stat)             ___x_cmd_mac_od_stat            "$@" ;;

        u|usr|user)         ___x_cmd_mac_od_user            "$@" ;;
        r|request)          ___x_cmd_mac_od_request         "$@" ;;
        m|mod)              ___x_cmd_mac_od_mod             "$@" ;;
        n|node)             ___x_cmd_mac_od_node            "$@" ;;
        nn|nodename)        ___x_cmd_mac_od_nodename        "$@" ;;

        all)                ___x_cmd_mac_od_all             "$@" ;;

        cache)              ___x_cmd_mac_od_cache           "$@" ;;
        log)                ___x_cmd_mac_od_log             "$@" ;;

        *)                  ___x_cmd_mac_ss_attr "$op"      "$@" ;;
    esac
}

___x_cmd_mac_od_user(){
    [ $# -gt 0 ]    ||      set -- show
    case "$1" in
        -h|--help)  ___x_cmd help -m mac od user      ;;
        show)       ___x_cmd_cmds odutil show users   ;;
    esac
}

___x_cmd_mac_od_request(){
    [ $# -gt 0 ]    ||      set -- show
    case "$1" in
        -h|--help)  ___x_cmd help -m mac od request      ;;
        show)       ___x_cmd_cmds odutil show requests   ;;
    esac
}


___x_cmd_mac_od_mod(){
    [ $# -gt 0 ]    ||      set -- show
    case "$1" in
        -h|--help)  ___x_cmd help -m mac od modules      ;;
        show)       ___x_cmd_cmds odutil show modules   ;;
    esac
}

___x_cmd_mac_od_node(){
    [ $# -gt 0 ]    ||      set -- show
    case "$1" in
        -h|--help)  ___x_cmd help -m mac od node            ;;
        show)       ___x_cmd_cmds odutil show nodes         ;;
    esac
}

___x_cmd_mac_od_nodename(){
    [ $# -gt 0 ]    ||      set -- show
    case "$1" in
        -h|--help)  ___x_cmd help -m mac od nodename        ;;
        show)       ___x_cmd_cmds odutil show nodenames     ;;
    esac
}

___x_cmd_mac_od_session(){
    [ $# -gt 0 ]    ||      set -- show
    case "$1" in
        -h|--help)  ___x_cmd help -m mac od nodename        ;;
        show)       ___x_cmd_cmds odutil show sessions      ;;
    esac
}

___x_cmd_mac_od_connection(){
    [ $# -gt 0 ]    ||      set -- show
    case "$1" in
        -h|--help)  ___x_cmd help -m mac od connection        ;;
        show)       ___x_cmd_cmds odutil show connections     ;;
    esac
}

___x_cmd_mac_od_all(){
    [ $# -gt 0 ]    ||      set -- show
    case "$1" in
        -h|--help)  ___x_cmd help -m mac od all        ;;
        show)       ___x_cmd_cmds odutil show all     ;;
    esac
}



___x_cmd_mac_od_log(){
    [ $# -gt 0 ]    ||      set -- set
    case "$1" in
        -h|--help)  ___x_cmd help -m mac od log          ;;
        set)        ___x_cmd_mac_od_log_set         "$2" ;;
        *)          ___x_cmd_mac_od_log_set         "$1" ;;
    esac
    # how to get log status ?
}

___x_cmd_mac_od_log_set(){
    ___x_cmd_cmds odutil set log "$@"
}


