From 0e7a823c7260bb5e1fd581d264e99628c1d5afc1 Mon Sep 17 00:00:00 2001 From: raul Date: Thu, 23 May 2024 13:49:06 +0200 Subject: [PATCH] Add basic documentation --- cmd/generate-ca.go | 9 ++------- cmd/root.go | 9 ++------- cmd/server.go | 8 +++----- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/cmd/generate-ca.go b/cmd/generate-ca.go index 3f0ac24..40270fd 100644 --- a/cmd/generate-ca.go +++ b/cmd/generate-ca.go @@ -11,13 +11,8 @@ import ( // generateCmd represents the generate command var generatecaCmd = &cobra.Command{ Use: "generate-ca", - Short: "A brief description of your command", - Long: `A longer description that spans multiple lines and likely contains examples -and usage of using your command. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, + Short: "Generate CA certificates for the webserver to use", + Long: `Generate CA certificates for the webserver to use`, Run: func(cmd *cobra.Command, args []string) { generateCA() }, diff --git a/cmd/root.go b/cmd/root.go index 4766db3..4b139ee 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -16,13 +16,8 @@ var cfgFile string var rootCmd = &cobra.Command{ Use: "cert400", - Short: "A brief description of your application", - Long: `A longer description that spans multiple lines and likely contains -examples and usage of using your application. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, + Short: "CA Web-Server capable of generating signed certificates", + Long: `CA Web-Server capable of generating signed certificates`, // Uncomment the following line if your bare application // has an action associated with it: // Run: func(cmd *cobra.Command, args []string) { }, diff --git a/cmd/server.go b/cmd/server.go index 8988194..cb6b8dc 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -19,9 +19,7 @@ var serverCmd = &cobra.Command{ func init() { rootCmd.AddCommand(serverCmd) - serverCmd.Flags().StringP("cert", "c", "$HOME/.config/cert400/server.crt", "CA certificate") - serverCmd.Flags().StringP("key", "k", "$HOME/.config/cert400/server.key", "CA private key") -} -func setServerParams(cmd *cobra.Command) error { - return nil + // TODO: Allow choosing CA certificates by parameter + // serverCmd.Flags().StringP("cert", "c", "$HOME/.config/cert400/server.crt", "CA certificate") + // serverCmd.Flags().StringP("key", "k", "$HOME/.config/cert400/server.key", "CA private key") }