diff --git a/dirs b/ds similarity index 86% rename from dirs rename to ds index ddc4053..3e5f58a 100755 --- a/dirs +++ b/ds @@ -1,6 +1,6 @@ #!/usr/bin/perl -# dirs - calculate and display the size of a given directory in a human readable format +# ds - calculate and display the size of a given directory in a human readable format # Copyright Frederick Boniface 2023 - fredboniface.co.uk # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -25,8 +25,13 @@ use strict; use warnings; use File::Find; -if (@ARGV != 1) { - die "Usage: $0 \n" +if (@ARGV == 0) { + print < + +Calculate the size of a directory and its contents.\n +EOF + exit; } my $dir_path = $ARGV[0]; @@ -36,7 +41,7 @@ unless (-d $dir_path) { } if ($dir_path eq '/') { - die "You are not able to run 'dirs' on the root directory\n" + die "You are not able to run 'ds' on the root directory\n" } my $total_size = 0;