Make FileContentFlag a struct to keep track of the path.

This commit is contained in:
Alec Thomas
2018-09-22 17:09:28 +10:00
parent 1048bd0448
commit 0f67a38060
2 changed files with 8 additions and 3 deletions
+2 -1
View File
@@ -164,5 +164,6 @@ func TestFileContentFlag(t *testing.T) {
f.Close()
_, err = mustNew(t, &cli).Parse([]string{"--file", f.Name()})
require.NoError(t, err)
require.Equal(t, []byte("hello world"), []byte(cli.File))
require.Equal(t, []byte("hello world"), cli.File.Data)
require.Equal(t, f.Name(), cli.File.Path)
}