INNER CODE UNIT · Go
init
kopecmaciej/vi-mongo · cmd/cmd.go:46
func init() {
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "config file (default is $HOME/.config/vi-mongo/config.yaml)")
rootCmd.Flags().BoolVarP(&showVersion, "version", "v", false, "Show version")
rootCmd.Flags().BoolVarP(&debug, "debug", "d", false, "Enable debug mode")
rootCmd.Flags().BoolVarP(&welcomePage, "welcome-page", "w", false, "Show welcome page on startup")
rootCmd.Flags().BoolVarP(&connectionPage, "connection-page", "p", false, "Show connection page on startup")
rootCmd.Flags().StringVarP(&connectionName, "connection-name", "n", "", "Connect to a specific MongoDB connection by name")
rootCmd.Flags().BoolVarP(&listConnections, "connection-list", "l", false, "List all available connections")
rootCmd.Flags().StringVar(&encryptionKeyPath, "key-path", "", "Path to the encryption key file")
rootCmd.Flags().Bool("gen-key", false, "Generate valid encryption key")
rootCmd.Flags().Bool("paths", false, "Show paths to config files and log")
rootCmd.Flags().StringVarP(&jumpInto, "jump", "j", "", "Jump directly to database/collection (format: db-name/collection-name)")
}
func runApp(cmd *cobra.Command, args []string) {
if ok, _ := cmd.Flags().GetBool("paths"); ok {
printPaths()
os.Exit(0)