diff --git a/core/commands/add.go b/core/commands/add.go index 75f65d1c5..b357ee4ba 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -117,7 +117,7 @@ You can now check what blocks have been created by: cmdkit.BoolOption(trickleOptionName, "t", "Use trickle-dag format for dag generation."), cmdkit.BoolOption(onlyHashOptionName, "n", "Only chunk and hash - do not write to disk."), cmdkit.BoolOption(wrapOptionName, "w", "Wrap files with a directory object."), - cmdkit.StringOption(pathName, "Assign path name when use wrap-with-directory option"), + cmdkit.StringOption(pathName, "Assign a name if the file source is stdin."), cmdkit.BoolOption(hiddenOptionName, "H", "Include files that are hidden. Only takes effect on recursive add."), cmdkit.StringOption(chunkerOptionName, "s", "Chunking algorithm, size-[bytes] or rabin-[min]-[avg]-[max]").WithDefault("size-262144"), cmdkit.BoolOption(pinOptionName, "Pin this object when adding.").WithDefault(true), diff --git a/core/coreunix/add.go b/core/coreunix/add.go index 3a89aa0c5..d3ac72d67 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -472,7 +472,7 @@ func (adder *Adder) addFile(file files.File) error { } addFileName := file.FileName() - if addFileName == "" && adder.Name != "" { + if (file.FullPath() == "/dev/stdin" || file.FullPath() == "") && adder.Name != "" { addFileName = adder.Name adder.Name = "" }