From 96db58083cc741d5907d4c00c95c811e45b5d20c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 18 Nov 2024 18:50:54 +0100 Subject: [PATCH] lsblk --- sh/alias/lsblk.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sh/alias/lsblk.sh b/sh/alias/lsblk.sh index 398bc42..86e91be 100644 --- a/sh/alias/lsblk.sh +++ b/sh/alias/lsblk.sh @@ -1,27 +1,31 @@ # list block devices -lb() { - lbo \ +lb() { sh_a__list_block "${@}"; } +sh_a__list_block() { + sh_a__list_block_output \ "SIZE" \ "TYPE" \ "FSTYPE" \ "LABEL" \ - "MOUNTPOINTS" + "MOUNTPOINTS" \ + "${@}" } # base arguments -lbb() { +lbne() { sh_a__list_block_no_empty "${@}"; } +sh_a__list_block_no_empty() { lsblk \ --noempty \ "${@}" } # output arguments -lbo() { +lbo() { sh_a__list_block_output "${@}"; } +sh_a__list_block_output() { local argument local arguments="NAME" for argument in "${@}"; do arguments="${arguments},${argument}" done - lbb \ + sh_a__list_block_no_empty \ --output "${arguments}" }