Add shorthand parameters

This commit is contained in:
raul 2024-05-08 08:34:07 +02:00
parent 61e35fd758
commit 2571936a48
2 changed files with 4 additions and 4 deletions

View File

@ -41,8 +41,8 @@ func init() {
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// clientCmd.PersistentFlags().String("foo", "", "A help for foo")
clientCmd.PersistentFlags().String("ip", "", "Server IP to connect to")
clientCmd.PersistentFlags().String("port", "1302", "Server port to connect to")
clientCmd.PersistentFlags().StringP("ip", "i", "", "Server IP to connect to")
clientCmd.PersistentFlags().StringP("port", "p", "1302", "Server port to connect to")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:

View File

@ -36,8 +36,8 @@ func init() {
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// serverCmd.PersistentFlags().String("foo", "", "A help for foo")
serverCmd.PersistentFlags().String("port", "1302", "port to use for listening")
serverCmd.PersistentFlags().String("history", "", "File to store and recover chat history from")
serverCmd.PersistentFlags().StringP("port", "p", "1302", "port to use for listening")
serverCmd.PersistentFlags().StringP("history", "r", "", "File to store and recover chat history from")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.: