{"id":17875735,"url":"https://github.com/conero/uymas","last_synced_at":"2025-04-03T00:23:29.233Z","repository":{"id":144200485,"uuid":"155320146","full_name":"conero/uymas","owner":"conero","description":"personal go-lib from the working","archived":false,"fork":false,"pushed_at":"2024-05-19T13:57:53.000Z","size":1108,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-19T14:49:53.813Z","etag":null,"topics":["cmd","go","go-utils","golang","ini-parser"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/conero.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog_zh-CN.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-30T03:39:24.000Z","updated_at":"2024-05-22T11:40:38.772Z","dependencies_parsed_at":"2024-05-19T14:45:36.708Z","dependency_job_id":null,"html_url":"https://github.com/conero/uymas","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conero%2Fuymas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conero%2Fuymas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conero%2Fuymas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conero%2Fuymas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/conero","download_url":"https://codeload.github.com/conero/uymas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246912802,"owners_count":20853927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmd","go","go-utils","golang","ini-parser"],"created_at":"2024-10-28T11:24:55.677Z","updated_at":"2025-04-03T00:23:28.802Z","avatar_url":"https://github.com/conero.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Uymas\n\nGolang 常用包，快速实现命令行程序开发、struct合并、随机数等生成.\n\n[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/conero/uymas?label=Latest%20Version\u0026color=teal)](https://github.com/conero/uymas/releases/latest)\n[![Go](https://img.shields.io/badge/go-1.18-cyan.svg)](https://golang.org)  [![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-blue?logo=go\u0026logoColor=white)](https://pkg.go.dev/gitee.com/conero/uymas?tab=doc) [![Report Card](https://goreportcard.com/badge/gitee.com/conero/uymas)](https://goreportcard.com/report/gitee.com/conero/uymas)   [![Goproxy.cn](https://goproxy.cn/stats/gitee.com/conero/uymas/badges/download-count.svg)](https://goproxy.cn)  [![](https://goreportcard.com/badge/gitee.com/uymas/conero)](https://goreportcard.com/report/gitee.com/conero/uymas)  [![Go](https://github.com/conero/uymas/actions/workflows/go.yml/badge.svg)](https://github.com/conero/uymas/actions/workflows/go.yml) \n\n\n\n**代码仓库介绍**\n\n- [~~github~~](https://github.com/conero/uymas) 由于网络原因取消该站点\n- [gitee](https://gitee.com/conero/uymas)\n\n\n\n\n### 项目介绍\ngo 语言工具库\ngo-version： *v1.18*\n\n- source\n    - bin    命令行解析工具\n\n\n\n支持 *[golangci-lint](https://github.com/golangci/golangci-lint)* 推荐规范\n\n```shell\n# 执行规范推荐\ngolangci-lint run ./...\n\n# 执行所有测试用例\ngo test ./...\n```\n\n\n\n**分支介绍**\n\n- master 项目主分支\n- develop 开发分支\n- nestling  雏形分支，包含实验性的代码\n\n\n\n```powershell\n# 分支合并顺序\nnestling --\u003e develop --\u003emaster\n```\n\n\n\n\n\n### 安装\n\n```ini\n# github\n$ go get -u gitee.com/conero/uymas\n```\n\n\n\n内置环境变量\n\n```ini\n# logger/lgr 包，设置日志级别：\nUYMAS_LGR_LEVEL = info\n\n# uymas 命令\nUYMAS_CMD_UYMAS_LONG = true\nUYMAS_CMD_UYMAS_COLON = false\n```\n\n\n\n\n\n#### bin\n\n\u003e 命令行行语法\n\u003e\n\u003e `$ [command] [\u003coptions\u003e]`\n\n```ini\n$ [command] [\u003coptions\u003e]\n# [\u003coptions\u003e] 格式如下\n\n\n# 1. 配置参数；全称以及简写\n--set[=true]\n# - 表示单字符; -x; -xy =\u003e -x -y ; -xzy =\u003e x=zy\n-short[=true]\n\n\n# 2. 二级命令(紧接着 [command])\n$ [command] [\u003csub-command\u003e] [\u003coptions\u003e]\n```\n\n\n\n##### plugin sub command（PSC）\n\n插件式子命令\n\n通过扫描二进制所在目录\"\\$/\"及“$/plg\"下可执行文件，若存在将其视为PSC。\n\n支持命名格式：\n\n- \\$/\\$app-name           name\n- \\$/\\$app_name           name\n- \\$/name                      name\n- $/plg/\\$app-name     name\n- \\$/plg/\\$app_name     name\n\n\n\n#### tinygo\n\n`Experimental/Try`  尝试实验性支持 [tinygo](https://github.com/tinygo-org/tinygo)  支持版本不低于 `v0.31.0`\n\n\n\n如编译：\n\n```shell\n# 编译 tiny 包\ntinygo build ./cmd/tiny\n```\n\n\n\n### 使用\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"gitee.com/conero/uymas/bin\"\n)\n// 命令 test\ntype Test struct {\n\tbin.Command\n}\n// 项目初始化\nfunc (a *Test) Init ()  {\n    // 重写方法时必先系统父结构体方法[!!]\n    a.Command.Init()\n    \n    // todo ....\n}\n// 运行，执行内二级命令分发\nfunc (a *Test) Run ()  {\n\tfmt.Println(\"ffff.\")\n}\n\n// 命令 yang\ntype Yang struct {\n\tbin.Command\n}\n\n\nfunc main() {\n\t//router := \u0026bin.Router{}\n\t//bin.Register(\"test\", \u0026Test{})\n\t//bin.Register(\"yang\", \u0026Yang{})\n\t//bin.Adapter(router)\n\tbin.RegisterApps(map[string]interface{}{\n\t\t\"test\": \u0026Test{},\n\t\t\"yang\": \u0026Yang{},\n\t})\n\tbin.Run()\n}\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconero%2Fuymas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconero%2Fuymas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconero%2Fuymas/lists"}