2023-11-06 07:33:52 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"log"
|
|
|
|
|
|
2023-11-08 07:33:19 +00:00
|
|
|
"github.com/AYM1607/ccclip/internal/configfile"
|
2023-11-06 07:33:52 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// rootCmd represents the base command when called without any subcommands
|
|
|
|
|
var rootCmd = &cobra.Command{
|
|
|
|
|
Use: "ccclip",
|
|
|
|
|
Short: "copy strings to and from your end to end encrypted cloud clipboard",
|
|
|
|
|
Long: `copy strings to and from your end to end encrypted cloud clipboard`,
|
|
|
|
|
// Uncomment the following line if your bare application
|
|
|
|
|
// has an action associated with it:
|
|
|
|
|
// Run: func(cmd *cobra.Command, args []string) { },
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
2023-11-08 07:33:19 +00:00
|
|
|
rootCmd.PersistentFlags().StringVarP(&configfile.Path, "config-path", "c", "", "directory where to store the config file")
|
2023-11-06 07:33:52 +00:00
|
|
|
|
2023-11-08 07:33:19 +00:00
|
|
|
rootCmd.MarkPersistentFlagRequired("config-path")
|
2023-11-06 07:33:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Execute adds all child commands to the root command and sets flags appropriately.
|
|
|
|
|
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
|
|
|
|
func Execute() {
|
|
|
|
|
err := rootCmd.Execute()
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Fatalln(err.Error())
|
|
|
|
|
}
|
|
|
|
|
}
|