Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use cli framework and handlers structure #2

Merged
merged 7 commits into from
Oct 5, 2023
Merged

refactor: use cli framework and handlers structure #2

merged 7 commits into from
Oct 5, 2023

Conversation

AH-dark
Copy link
Member

@AH-dark AH-dark commented Oct 5, 2023

No description provided.

@purofle purofle self-requested a review October 5, 2023 09:13
main.go Show resolved Hide resolved
cli/app.go Outdated Show resolved Hide resolved
Copy link
Member

@2096779623 2096779623 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~/fadian-go $ ./fadian-go
NAME:
   fadian-go - 发癫

USAGE:
   fadian-go [global options] command [command options] [arguments...]

VERSION:
   0.0.1-0000000

AUTHORS:
   AH Dark <[email protected]>
   Kevin Williams
   Purofle

COMMANDS:
   fadian
   fabing
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --debug, -d    是否开启调试模式 (default: false) [$DEBUG]
   --num value    重复次数 (default: 1)
   --help, -h     show help
   --version, -v  print the version

COPYRIGHT:
   2022-2023 © 爱发癫 All Rights Reserved
~/fadian-go $

更新一下README.md

@2096779623
Copy link
Member

~/fadian-go $ ./fadian-go -v
flag provided but not defined: -v
Usage of ./fadian-go:
  -d    是否开启调试模式
~/fadian-go $ ./fadian-go -h
Usage of ./fadian-go:
  -d    是否开启调试模式
~/fadian-go $ ./fadian-go --version
flag provided but not defined: -version
Usage of ./fadian-go:
  -d    是否开启调试模式
~/fadian-go $

好像有bug

@2096779623
Copy link
Member

2096779623 commented Oct 5, 2023

~/fadian-go $ ./fadian-go fabing
NAME:
   fadian-go fabing

USAGE:
   fadian-go fabing [command options] [arguments...]

OPTIONS:
   --name value, -n value  name to be fabing
   --help, -h              show help
panic: Required flag "name" not set; sync /dev/stderr: invalid argument

goroutine 1 [running]:
main.main()
        /data/data/com.termux/files/home/fadian-go/main.go:35 +0x64
~/fadian-go $ ./fadian-go fabing -n a
~/fadian-go $ ./fadian-go fadian -n a
我好想做 a 小姐的狗啊。

fabing seems doesn't work.

@AH-dark
Copy link
Member Author

AH-dark commented Oct 5, 2023

~/fadian-go $ ./fadian-go -v
flag provided but not defined: -v
Usage of ./fadian-go:
  -d    是否开启调试模式
~/fadian-go $ ./fadian-go -h
Usage of ./fadian-go:
  -d    是否开启调试模式
~/fadian-go $ ./fadian-go --version
flag provided but not defined: -version
Usage of ./fadian-go:
  -d    是否开启调试模式
~/fadian-go $

好像有bug

Fixed. This seems to be a conflict between flags package and cli framework.

@AH-dark
Copy link
Member Author

AH-dark commented Oct 5, 2023

@2096779623 Now you need to use such a command to release a new tag, CI will help you generate a draft release.

git tag v1.0.0
git push --tags

@AH-dark AH-dark requested review from purofle and 2096779623 October 5, 2023 14:03
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

{Name: "Kevin Williams", Email: ""}, // TODO: add email
{Name: "Purofle", Email: ""}, // TODO: add email
},
EnableBashCompletion: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有bash completion?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can set it up. But during the current situation, I think this feature is not necessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@2096779623
Copy link
Member

@2096779623 Now you need to use such a command to release a new tag, CI will help you generate a draft release.

git tag v1.0.0
git push --tags

Now you are admin!

@purofle purofle merged commit cefd429 into afadian:main Oct 5, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants