Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "", PersistentPreRun: func(cmd *cobra.Command, args []string) { if cmd.Name() == "help" { return } if len(archiveFile) == 0 { exitWithErr(errNoArchiveFile) } archiveFile = fixArchivePath(archiveFile) if cmd.Name() == "create" { if archiveExists(archiveFile) { exitWithErr(errArchiveExists) } } else { if !archiveExists(archiveFile) { exitWithErr(errArchiveDoesNotExist) } } if chunkSize < minChunkSize { exitWithErr(errInvalidChunkSize) } envPwd := os.Getenv("PASSWORD") password := []byte(envPwd) if len(password) == 0 { password = readPassword("Password") if cmd.Name() == "create" { pwdRepeat := readPassword("Repeat password") if !bytes.Equal(password, pwdRepeat) { exitWithErr(errPWDoNotMatch) } } } config := config.Config{ Path: archiveFile, Password: password, Compression: useCompression, ChunkSize: chunkSize, } var err error arch, err = archive.NewArchive(&config) if err != nil { exitWithErr(err) } }, PersistentPostRun: func(cmd *cobra.Command, args []string) { if arch != nil { arch.Close() } }, }
RootCmd is the main command that is always executed.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.