#define hdparm_trivial_usage \
"[options] [device] .."
#define hdparm_full_usage \
- USE_FEATURE_HDPARM_GET_IDENTITY("\tIf no device name is specified read from stdin.\n") \
+ USE_FEATURE_HDPARM_GET_IDENTITY("\tIf no device name is specified try to read from stdin.\n") \
"\nOptions:\n" \
"\t-a get/set fs readahead\n" \
"\t-A set drive read-lookahead flag (0/1)\n" \
argc -= optind;
argv += optind;
-#if ENABLE_FEATURE_HDPARM_GET_IDENTITY
if (argc < 1) {
- identify_from_stdin(); /* EXIT */
+ if (ENABLE_FEATURE_HDPARM_GET_IDENTITY && !isatty(STDIN_FILENO))
+ identify_from_stdin(); /* EXIT */
+ else bb_show_usage();
}
-#endif
while (argc--) {
process_dev(*argv);