mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 10:01:01 +03:00
3bfc7f1b20
The -p option is used to specify a specific page of output to be displayed. If omitted, all output pages would be displayed. arc_summary, as it stood, had really kludgy processing code for processing the -p option. It relied on a try-except block which was treated as an if statement and in normal operation would fail any time a user didn't specify the -p option on the command line. When the exception was thrown, the script would then display all output pages. This happened whether the -p option was omitted or malformed. Thus, in the principle use case, an exception would be raised in order to run the script as desired. The same except code would be called regardless of the exception, however, and malformed -p arguments would also cause the script to execute. Additionally, this required the function which handles the case where all output pages were to be displayed, _call_all, to be potentially called from several locations within main. This commit refactors the option processing code to simplify it and make it easier to catch runtime errors in the script. This is done by specializing the try-except block to only have an exception when the -p argument is malformed. When the -p option is correctly selected by the user, it calls a function in the unSub array directly, which will only display one page of output. Finally in the context of this refactoring the page breaks have been removed. Pages seem to have been added into the output in the FreeNAS version of the script. This patch removes pages from the output to more closely resemble the freebsd version of the script. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Kyle Blatter <kyleblatter@llnl.gov> Signed-off-by: Ned Bass <bass6@llnl.gov> |
||
---|---|---|
.. | ||
arc_summary | ||
arcstat | ||
dbufstat | ||
fsck_zfs | ||
mount_zfs | ||
vdev_id | ||
zdb | ||
zed | ||
zfs | ||
zhack | ||
zinject | ||
zpios | ||
zpool | ||
zstreamdump | ||
ztest | ||
zvol_id | ||
Makefile.am |