summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-10-15 09:56:03 +0000
committerJim Meyering <jim@meyering.net>2005-10-15 09:56:03 +0000
commit9624dcd0ee93aeee7af21abb5f3cb4bed8e3a3c8 (patch)
tree0f285dd1d945c000eba9d9a9d527e34dce0008e9 /src
parenta7164e425a7bce45c394b2b0709e34a639aa81d5 (diff)
downloadcoreutils-9624dcd0ee93aeee7af21abb5f3cb4bed8e3a3c8.tar.xz
(main): Warn about the deprecated --kilobytes option.
Diffstat (limited to 'src')
-rw-r--r--src/df.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/df.c b/src/df.c
index c48f21287..a40aa6dbc 100644
--- a/src/df.c
+++ b/src/df.c
@@ -114,8 +114,10 @@ static bool print_type;
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
enum
{
- SYNC_OPTION = CHAR_MAX + 1,
- NO_SYNC_OPTION
+ NO_SYNC_OPTION = CHAR_MAX + 1,
+ /* FIXME: --kilobytes is deprecated (but not -k); remove in late 2006 */
+ KILOBYTES_LONG_OPTION,
+ SYNC_OPTION
};
static struct option const long_options[] =
@@ -125,7 +127,7 @@ static struct option const long_options[] =
{"inodes", no_argument, NULL, 'i'},
{"human-readable", no_argument, NULL, 'h'},
{"si", no_argument, NULL, 'H'},
- {"kilobytes", no_argument, NULL, 'k'}, /* long form is obsolescent */
+ {"kilobytes", no_argument, NULL, KILOBYTES_LONG_OPTION},
{"local", no_argument, NULL, 'l'},
{"megabytes", no_argument, NULL, 'm'}, /* obsolescent */
{"portability", no_argument, NULL, 'P'},
@@ -802,6 +804,10 @@ main (int argc, char **argv)
human_output_opts = human_autoscale | human_SI;
output_block_size = 1;
break;
+ case KILOBYTES_LONG_OPTION:
+ error (0, 0,
+ _("the --kilobytes option is deprecated; use -k instead"));
+ /* fall through */
case 'k':
human_output_opts = 0;
output_block_size = 1024;