Merge pull request 'feat(cli): 根命令支持 --version 标志' (#340) from Taoyouce/gitlink-cli:feat/root-version-flag into master
This commit is contained in:
commit
0c272d7209
|
|
@ -44,9 +44,11 @@ func NewRootCmd(opts RootOptions, tr *i18n.Translator) (*cobra.Command, error) {
|
|||
Use: "gitlink-cli",
|
||||
Short: tr.T("cmd.root.short"),
|
||||
Long: tr.T("cmd.root.long"),
|
||||
Version: version,
|
||||
SilenceUsage: true,
|
||||
SilenceErrors: true,
|
||||
}
|
||||
rootCmd.SetVersionTemplate(tr.Tf("output.version", i18n.Args{"version": version}) + "\n")
|
||||
|
||||
rootCmd.PersistentFlags().StringVar(&cmdutil.Owner, "owner", "", tr.T("flag.owner"))
|
||||
rootCmd.PersistentFlags().StringVar(&cmdutil.Repo, "repo", "", tr.T("flag.repo"))
|
||||
|
|
|
|||
Loading…
Reference in New Issue