Skip to content

When "-" is used for standard input, the filename in the context/unified headers should be "-", not "/dev/stdin" #46

Description

@oSoMoN

When passing in "-" as a parameter on the CLI invokation to use the standard input for either of the input files, in conjunction with the -c or -u options, the filenames displayed should be "-", not "/dev/stdin", to be consistent with GNU's implementation:

echo foo > foo

echo bar | /usr/bin/diff -u foo -
--- foo	2024-04-03 18:55:48.837847038 +0200
+++ -	2024-04-03 18:58:47.031319515 +0200
@@ -1 +1 @@
-foo
+bar

echo bar | cargo run --release -- -u foo -
--- foo	
+++ /dev/stdin	
@@ -1 +1 @@
-foo
+bar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions