# 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_gt     Bool                  =       true    false
param_type      ___x_cmd_gt     RepoPerm              =       pull    push     admin
param_type      ___x_cmd_gt     RepoAllAccess         =       all     private  public
param_type      ___x_cmd_gt     RepoAccess            =       private public
param_type      ___x_cmd_gt     OrganizationsAccess   =       member  admin
param_type      ___x_cmd_gt     EnterpriceAccess      =       member  admin    outsourced
param_type      ___x_cmd_gt     UserRole              =       all     member   admin
param_type      ___x_cmd_gt     Direction             =       asc     desc
param_type      ___x_cmd_gt     Sort                  =       created updated
param_type      ___x_cmd_gt     IssueState            =       all     open     progressing  closed  rejected
param_type      ___x_cmd_gt     IssueFilter           =       all     assigned created
param_type      ___x_cmd_gt     NatureNumber          "=~"    "[0-9]+"
param_type      ___x_cmd_gt     UserName              "=~"    "[-A-Za-z0-9_,]+"
param_type      ___x_cmd_gt     RepoName              "=~"    "[-A-Za-z0-9_]+"
param_type      ___x_cmd_gt     RepoPath              "=~"    "[-A-Za-z0-9_/]+"      # TODO: make it fit it gitee definition
param_type      ___x_cmd_gt     MultipleRepoPath      "=~"    "[-A-Za-z0-9_/,]+"
param_type      ___x_cmd_gt     OrgSpaceName          "=~"    "[-A-Za-z0-9_]+"
param_type      ___x_cmd_gt     EnterpriseSpaceName   "=~"    "[-A-Za-z0-9_]+"
param_type      ___x_cmd_gt     Address               "=~"    "[-A-Za-z0-9_]+|https?://.+"
param_type      ___x_cmd_gt     PerPage               "=~"    "([0-9]|(([1-9][0-9]))|100)"
param_type      ___x_cmd_gt     ISOTime               "=~"    "[0-9]+(\/|-)?(1[0-2]|0?[1-9])(\/|-)?(0?[1-9]|[1-2][0-9]|30|31) (:?[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$"
param_type      ___x_cmd_gt    Ignore                -   <<A
$(xrc cat gt/lib/_type/ignore.txt)
A
param_type      ___x_cmd_gt     License              -   <<A
$(xrc cat gt/lib/_type/license.txt)
A

# TODO: wait param
# param_type      ___x_cmd_gt     Numbers           "=~"      "[0-9]+|(\\s&&[^\\f\\n\\r\\t\\v])*"
# param_type      ___x_cmd_gt     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_gt     URL               "=~"      "https?://.+|(\\s&&[^\\f\\n\\r\\t\\v])*"