mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
Update control flags and usage message
This commit is contained in:
parent
15a3ea8a08
commit
0ab150ba89
1 changed files with 4 additions and 1 deletions
|
@ -30,7 +30,7 @@ var (
|
||||||
|
|
||||||
rootCmd = &cobra.Command{
|
rootCmd = &cobra.Command{
|
||||||
Use: "portmaster-control",
|
Use: "portmaster-control",
|
||||||
Short: "contoller for all portmaster components",
|
Short: "Controller for all portmaster components",
|
||||||
PersistentPreRunE: cmdSetup,
|
PersistentPreRunE: cmdSetup,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
if showShortVersion {
|
if showShortVersion {
|
||||||
|
@ -43,6 +43,7 @@ var (
|
||||||
}
|
}
|
||||||
return cmd.Help()
|
return cmd.Help()
|
||||||
},
|
},
|
||||||
|
SilenceUsage: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -52,6 +53,8 @@ func init() {
|
||||||
|
|
||||||
rootCmd.PersistentFlags().StringVar(&dataDir, "data", "", "set data directory")
|
rootCmd.PersistentFlags().StringVar(&dataDir, "data", "", "set data directory")
|
||||||
rootCmd.PersistentFlags().StringVar(&databaseDir, "db", "", "alias to --data (deprecated)")
|
rootCmd.PersistentFlags().StringVar(&databaseDir, "db", "", "alias to --data (deprecated)")
|
||||||
|
rootCmd.MarkPersistentFlagDirname("data")
|
||||||
|
rootCmd.MarkPersistentFlagDirname("db")
|
||||||
rootCmd.Flags().BoolVar(&showFullVersion, "version", false, "print version")
|
rootCmd.Flags().BoolVar(&showFullVersion, "version", false, "print version")
|
||||||
rootCmd.Flags().BoolVar(&showShortVersion, "ver", false, "print version number only")
|
rootCmd.Flags().BoolVar(&showShortVersion, "ver", false, "print version number only")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue