urfave/sflags là dự án mã nguồn mở trên GitHub với 167 sao.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
$ go run ./main.go --help
Usage of _obj/exe/main:
-http-host value
HTTP host (default 127.0.0.1)
-http-port value
(default 6000)
-http-ssl
-http-timeout value
(default 15s)
exit status 2
Options for flag tag
The flag default key string is the struct field name but can be specified in the struct field's tag value.
The "flag" key in the struct field's tag value is the key name, followed by an optional comma and options. Examples:
// Field is ignored by this package.
Field int `flag:"-"`
// Field appears in flags as "myName".
Field int `flag:"myName"`
// If this field is from nested struct, prefix from parent struct will be ingored.
Field int `flag:"~myName"`
// You can set short name for flags by providing it's value after a space
// Prefixes will not be applied for short names.
Field int `flag:"myName a"`
// this field will be removed from generated help text.
Field int `flag:",hidden"`
// this field will be marked as deprecated in generated help text
Field int `flag:",deprecated"`
Options for desc tag
If you specify description in description tag (desc by default) it will be used in USAGE section.
Addr string `desc:"HTTP host"`
This description produces something like:
-addr value
HTTP host (default 127.0.0.1)
Options for env tag
If you specify environment variable name in env tag, it will be used to set the value of the field.
SSL bool `env:"HTTP_SSL_VALUE"`
Options for Parse function:
// DescTag sets custom description tag. It is "desc" by default.
func DescTag(val string)
// FlagTag sets custom flag tag. It is "flag" be default.
func FlagTag(val string)
// Prefix sets prefix that will be applied for all flags (if they are not marked as ~).
func Prefix(val string)
// EnvPrefix sets prefix that will be applied for all environment variables (if they are not marked as ~).
func EnvPrefix(val string)
// FlagDivider sets custom divider for flags. It is dash by default. e.g. "flag-name".
func FlagDivider(val string)
// EnvDivider sets custom divider for environment variables.
// It is underscore by default. e.g. "ENV_NAME".
func EnvDivider(val string)
// Validator sets validator function for flags.
// Check existed validators in sflags/validator package.
func Validator(val ValidateFunc)
// Set to false if you don't want anonymous structure fields to be flattened.
func Flatten(val bool)
// InheritHidden sets if fields should inherit the value of the hidden tag from parent structs.
func InheritHidden()
// InheritDeprecated sets if fields should inherit the value of the deprecated tag from parent structs.
func InheritDeprecated()
Known issues
kingpin doesn't pass value for boolean arguments. Counter can't get initial value from arguments.
urfave/sflags có 167 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/urfave/sflags. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
urfave/sflags có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho urfave/sflags. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
urfave/sflags còn được duy trì không?
TopGit chưa ghi nhận lần push gần đây của urfave/sflags. Xem lịch sử commit trực tiếp trên GitHub để biết thông tin chính xác nhất.
urfave/sflags là gì?
urfave/sflags (urfave/sflags) là dự án đa ngôn ngữ TopGit theo dõi. Tính tới lần đồng bộ gần nhất, repo có 167 sao.
urfave/sflags viết bằng ngôn ngữ gì?
Dữ liệu TopGit chưa ghi nhận ngôn ngữ chính cho urfave/sflags. Xem danh sách file trên GitHub để biết chi tiết.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc sflags có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về sflags.