Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit fa2d098

Browse files
committed
removing newlines, renaming cache argument to cache-dir
1 parent 46cdc7b commit fa2d098

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cmd/root.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,8 @@ func getImage(imageName string) (pkgutil.Image, error) {
141141
}
142142

143143
func getCacheDir(imageName string) (string, error) {
144-
145144
// First preference for cache is set at command line
146145
if cacheDir == "" {
147-
148146
// second preference is environment
149147
cacheDir = os.Getenv(containerDiffEnvCacheDir)
150148
}
@@ -153,7 +151,7 @@ func getCacheDir(imageName string) (string, error) {
153151
if cacheDir == "" {
154152
dir, err := homedir.Dir()
155153
if err != nil {
156-
return "", err
154+
return "", errors.Wrap(err, "retrieving home dir")
157155
} else {
158156
cacheDir = dir
159157
}
@@ -201,6 +199,6 @@ func addSharedFlags(cmd *cobra.Command) {
201199
cmd.Flags().BoolVarP(&save, "save", "s", false, "Set this flag to save rather than remove the final image filesystems on exit.")
202200
cmd.Flags().BoolVarP(&util.SortSize, "order", "o", false, "Set this flag to sort any file/package results by descending size. Otherwise, they will be sorted by name.")
203201
cmd.Flags().BoolVarP(&noCache, "no-cache", "n", false, "Set this to force retrieval of image filesystem on each run.")
204-
cmd.Flags().StringVarP(&cacheDir, "cache", "c", "", "cache directory base to create .container-diff (default is $HOME).")
202+
cmd.Flags().StringVarP(&cacheDir, "cache-dir", "c", "", "cache directory base to create .container-diff (default is $HOME).")
205203

206204
}

0 commit comments

Comments
 (0)