# shellcheck shell=sh
# shellcheck disable=SC2039,3043

# author:       Li Junhao           edwin.jh.lee@gmail.com    edwinjhlee.github.io
# maintainer:   Li Junhao

# Define in param
param_type      ___x_cmd_gl    Bool                  =       true   false
param_type      ___x_cmd_gl    RepoPerm              =       pull    push     admin
param_type      ___x_cmd_gl    RepoAllAccess         =       all     private  public
param_type      ___x_cmd_gl    RepoAccess            =       private public
param_type      ___x_cmd_gl    ExtraAccess           =       private public   innerSource
param_type      ___x_cmd_gl    UserRole              =       all member admin
param_type      ___x_cmd_gl    NatureNumber          "=~"    "[0-9]+"
param_type      ___x_cmd_gl    UserName              "=~"    "[-A-Za-z0-9_,/.=]+"
param_type      ___x_cmd_gl    RepoName              "=~"    "[-A-Za-z0-9_/.=]+"
param_type      ___x_cmd_gl    RepoPath              "=~"    "[-A-Za-z0-9_/.=]+"      # TODO: make it fit it gitlab definition
param_type      ___x_cmd_gl    OrgSpaceName          "=~"    "[-A-Za-z0-9_/.=]+"
param_type      ___x_cmd_gl    Address               "=~"    "[-A-Za-z0-9_/]+|https?://.+"
param_type      ___x_cmd_gl    Ignore                -   <<A
$(xrc cat gl/lib/_type/ignore.txt)
A
param_type      ___x_cmd_gl     License              -   <<A
$(xrc cat gl/lib/_type/license.txt)
A

# TODO: wait param
# param_type      ___x_cmd_gl     Numbers           "=~"      "[0-9]+|(\\s&&[^\\f\\n\\r\\t\\v])*"
# param_type      ___x_cmd_gl     ISOTime           "=~"      "/^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.[0-9]+)?(Z|[+-](?:2[0-3]|[01][0-9]):[0-5][0-9])?$/|(\\s&&[^\\f\\n\\r\\t\\v])*"
# param_type      ___x_cmd_gl     URL               "=~"      "https?://.+|(\\s&&[^\\f\\n\\r\\t\\v])*"