Git Product home page Git Product logo

gookit / gcli Goto Github PK

View Code? Open in Web Editor NEW
358.0 10.0 42.0 6.68 MB

🖥 Go CLI application, tool library, running CLI commands, support console color, user interaction, progress display, data formatting display, generate bash/zsh completion add more features. Go的命令行应用,工具库,运行CLI命令,支持命令行色彩,用户交互,进度显示,数据格式化显示,生成bash/zsh命令补全脚本

Home Page: https://gookit.github.io/gcli/

License: MIT License

Go 96.00% Shell 3.09% Dockerfile 0.49% Makefile 0.23% HTML 0.17% Smarty 0.02%
cli command-line cli-app console cli-application cli-progress-bar cli-commands commands console-application gookit

gcli's People

Contributors

aisbergg avatar codacy-badger avatar dependabot-preview[bot] avatar dependabot[bot] avatar hb0730 avatar inhere avatar rfyiamcool avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gcli's Issues

如何实现参数的继承

使用方法

app database create host=127.0.0.1 name=abc
app database delete host=127.0.0.1 name=abc
app database update host=127.0.0.1 name=abc content=hello

create,delete,update这三个字命令都需要host参数,能否在database这个command的结构体中定义公共的host参数,而不是三个子命令都各自定义一次?

gflag.AlignLeft 赋值给 gflag.Config.Alignment 出现类型转换错误

System (please complete the following information):

  • OS: macOS
  • GO Version: 1.19

该错误出现在 github.com/gookit/gcli/v3/gflag/parser.go:52:14 及 github.com/gookit/gcli/v3/app.go:102:19 中

gflag.Config.Alignment 为 uint8 而 gflag.AlignLeft 为 PosFlag 类型.
这两处将 gflag.AlignLeft 直接赋值给了 gflag.Config.Alignment 出现了错误, 望更正

缺少import模块

在mac平台下编译,报
github.com/gookit/gcli/v2/interact
../../pkg/mod/github.com/gookit/gcli/[email protected]/interact/read_nonwin.go:13:13: undefined: terminal
../../pkg/mod/github.com/gookit/gcli/[email protected]/interact/read_nonwin.go:13:35: undefined: syscall
异常。

-h 无法自动输出帮助信息

System (please complete the following information):

  • OS: Windows
  • GO Version: 1.18
  • Pkg Version: v3.0.3

Describe the bug

使用 xxx.exe -h 和 xxx.exe xxx -h 无法输出帮助
https://github.com/EldersJavas/EbiBuilder:

> D:\GitHub\EbiBuilder>EbiBuilder.exe
[Debug]2022/07/18 00:02:48.957: D:\GitHub\EbiBuilder\examples  
  --verbose                 Set logs reporting level(quiet 0 - 5 crazy) (default 1=error)
  --verbose                 Set logs reporting level(quiet 0 - 5 crazy) (default 1=error)
  -V, --version             Display app version information
  -V, --version             Display app version information
 

Available Commands:
  build        Build Ebitengine game (alias: Build,BUILD,buildgame)
  genac        Generate auto complete scripts for current application (alias: gen-ac)
  help         Display help information

Use "EbiBuilder.exe COMMAND -h" for more information about a command

--------------------------

>  D:\GitHub\EbiBuilder>EbiBuilder.exe build -h
[Debug]2022/07/18 00:03:26.348: D:\GitHub\EbiBuilder\examples
[Debug]2022/07/18 00:03:26.546: ebiten version=2.x

--------------------------

> D:\GitHub\EbiBuilder>EbiBuilder.exe -h
[Debug]2022/07/18 00:09:36.334: D:\GitHub\EbiBuilder\examples 
[Debug]2022/07/18 00:09:36.685: ebiten version=2.x
ERROR: flag: help requested

To Reproduce

https://github.com/EldersJavas/EbiBuilder

命令格式定义建议

能不能支持 类似 db:seeder 这样的定义方法 可以吧一些命令 归类 显示出来好看一点

现在这样定义会 抛出异常 panic: GCli: the command name 'db:seeder' is invalid, must match: ^[a-zA-Z][\w-]*$

关于交互式建议

  1. interact.ReadLine 是否新增必填选项

  2. interact.SelectOne

     SelectOne(title string, options interface{}, defOpt string, allowQuit ...bool)

    既然默认值已经是string,那optionsinterface是否能够确认类型,
    好像defOpt只能是字符串下标

    image
    这种可能想要的只是bool

参考 promptui

module path error

go: github.com/gookit/[email protected]: parsing go.mod: unexpected module path "github.com/gookit/cliapp"

github.com/gookit/cliapp -> github.com/gookit/gcli

clone

hi,how to show progress use git clone on Windows ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.