file's -I and --mime flags produce different output

Originator:SaagarJha28
Number:rdar://32697290 Date Originated:10-Jun-2017 9:24 PM
Status:Closed Resolved:29-Aug-2017 12:58 PM
Product:macOS + SDK Product Version:macOS High Sierra 10.13 Beta (17A264c)
Classification:Serious Bug Reproducible:
 
Area:
Something not on this list

Summary:
file's documentation clearly states that the -I and --mime flags are equivalent:

-I, --mime
             Causes the file command to output mime type strings rather than
             the more traditional human readable ones.  Thus it may say
             `text/plain; charset=us-ascii' rather than ``ASCII text''.

Thus, one would expect that "file -I test" and "file --mime test" give the exact same output. However, this is not the case:

$ file -I test
test: text/plain; charset=us-ascii
$ file --mime test
test: regular file

I'm thinking that file's broken, instead of the documentation, since the documentation matches how it's been for years.

Steps to Reproduce:
1. Find a plain text file (or generate one: echo "test" > test).
2. Run file -I and file --mime on this file.

Expected Results:
The output is identical.

Observed Results:
The output differs; file -I seems to be correct, but not file --mime.

Version:
macOS High Sierra 10.13 Beta (17A264c)

Notes:
Regression from macOS Sierra, I believe. I know this used to work until relatively recently.

Configuration:
Early 2015 MacBook Pro with Retina Display running macOS High Sierra 10.13 Beta (17A264c)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!