384
edits
Changes
→Second Milestone (due August 2)
* -l <number> will set the maximum length of the bar graph. The default should be 20 character. This option will require an option argument that is an integer.
* Your script will also require one positional argument which contains the target directory for scanning.
Your assignment should be able to produce the following:
<code><b>user@host ~ $ python3 duim.py -h</b></code>
<pre>
usage: duim.py [-h] [-H] [-l LENGTH] target
DU Improved -- See Disk Usage Report with bar charts
positional arguments:
target The directory to scan.
optional arguments:
-h, --help show this help message and exit
-H, --human-readable print sizes in human readable format (e.g. 1K 23M 2G)
-l LENGTH, --length LENGTH
Specify the length of the graph. Default is 20.
Copyright 2021
</pre>
Use the following to test your code: