https://github.com/zanjs/enumman2
https://github.com/zanjs/enumman2
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zanjs/enumman2
- Owner: zanjs
- Created: 2021-01-11T05:38:39.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-04T10:04:15.000Z (over 3 years ago)
- Last Synced: 2025-02-10T14:27:06.185Z (5 months ago)
- Language: Go
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Enum
A little tool to generate namespaced, type-checked and polyglot enums in Go.## Installation
```shell
$ go get github.com/zanjs/enumman2
```## Usage
```shell
$ enumman2 --help
Usage of ./enumman2:
-name string
name of the enum (default "Enum")
-output string
output file path (default "./%s_enumman.go")
-package string
name of the generated package (default "enums")
-keys string
keys indexs
-values string
values comma separated
-variant value
VariantName:Value1,Value2,...,VariantN
``````shell
$ enumman2 -package=enum -name OrderStatus \
-values=uncheck,unpaid,paid,processing,ordered,cancelled,invalid \
-keys=0,10,20,30,40,201,202 \
-variant=Descript:采购待审核,未支付,已付款,已采购,卖家已邮寄,已取消,无效单
```