--- Functions/Misc/run-help-sudo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Functions/Misc/run-help-sudo b/Functions/Misc/run-help-sudo index f38696e19..a8fa7aa0f 100644 --- a/Functions/Misc/run-help-sudo +++ b/Functions/Misc/run-help-sudo @@ -2,6 +2,6 @@ if [ $# -eq 0 ]; then man sudo else - man $1 + run-help $1 fi -- 2.19.1
--- Functions/Misc/run-help-btrfs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Functions/Misc/run-help-btrfs diff --git a/Functions/Misc/run-help-btrfs b/Functions/Misc/run-help-btrfs new file mode 100644 index 000000000..d9e3530c1 --- /dev/null +++ b/Functions/Misc/run-help-btrfs @@ -0,0 +1,31 @@ +if [ $# -eq 0 ]; then + man btrfs + return +fi + +while [[ $# != 0 && $1 == -* ]]; do + shift +done + +case $1 in + (b*) man btrfs-balance ;; + (c*) man btrfs-check ;; + (d*) man btrfs-device ;; + (f*) man btrfs-filesystem ;; + (i*) man btrfs-image ;; + (i*) man btrfs-inspect-internal ;; + (m*) man btrfs-map-logical ;; + (p*) man btrfs-property ;; + (q*) man btrfs-qgroup ;; + (q*) man btrfs-quota ;; + (rec*) man btrfs-receive ;; + (rep*) man btrfs-replace ;; + (resc*) man btrfs-rescue ;; + (rest*) man btrfs-restore ;; + (sc*) man btrfs-scrub ;; + (se*) man btrfs-send ;; + (su*) man btrfs-subvolume ;; + (*) man btrfs ;; +esac + +return $? -- 2.19.1
It seems we have missed two patches from Samir Benmendil.
(pointed out by Christian K, users/26216)
> 2018/12/28 0:24, Samir Benmendil <me@rmz.io> wrote:
>
> diff --git a/Functions/Misc/run-help-sudo b/Functions/Misc/run-help-sudo
> index f38696e19..a8fa7aa0f 100644
> --- a/Functions/Misc/run-help-sudo
> +++ b/Functions/Misc/run-help-sudo
> @@ -2,6 +2,6 @@
> if [ $# -eq 0 ]; then
> man sudo
> else
> - man $1
> + run-help $1
> fi
>
Can we assume that the function run-help is already loaded when run-help-sudo
is called? (I think yes, no one will use run-help-sudo without loading run-help).
If this is the case, I think the patch has no problem.
-----
Jun
Another patch we missed. > 2018/12/28 0:24, Samir Benmendil <me@rmz.io> wrote: > > --- /dev/null > +++ b/Functions/Misc/run-help-btrfs (snip) > + (i*) man btrfs-image ;; > + (m*) man btrfs-map-logical ;; These two are not subcommands of btrfs. > + (q*) man btrfs-qgroup ;; > + (q*) man btrfs-quota ;; These two must be distinguished. diff --git a/Functions/Misc/run-help-btrfs b/Functions/Misc/run-help-btrfs new file mode 100644 index 000000000..0dc1dabcb --- /dev/null +++ b/Functions/Misc/run-help-btrfs @@ -0,0 +1,22 @@ +while [[ $# != 0 && $1 == -* ]]; do + shift +done + +case $1 in + (b*) man btrfs-balance ;; + (c*) man btrfs-check ;; + (d*) man btrfs-device ;; + (f*) man btrfs-filesystem ;; + (i*) man btrfs-inspect-internal ;; + (p*) man btrfs-property ;; + (qg*) man btrfs-qgroup ;; + (qu*) man btrfs-quota ;; + (rec*) man btrfs-receive ;; + (rep*) man btrfs-replace ;; + (resc*) man btrfs-rescue ;; + (rest*) man btrfs-restore ;; + (sc*) man btrfs-scrub ;; + (se*) man btrfs-send ;; + (su*) man btrfs-subvolume ;; + (*) man btrfs ;; +esac ----- Jun
> > --- /dev/null
> > +++ b/Functions/Misc/run-help-btrfs
> (snip)
> > + (i*) man btrfs-image ;;
>
> > + (m*) man btrfs-map-logical ;;
>
> These two are not subcommands of btrfs.
>
> > + (q*) man btrfs-qgroup ;;
> > + (q*) man btrfs-quota ;;
>
> These two must be distinguished.
I'm sure there were some changes to btrfs subcommands in the meantime.
As far as I can tell you can shorten all subcommands for btrfs as long
as they are unique. So I'd expect this would need to be updated once
in a while. So this way of doing it could lead to the wrong man page
being displayed but otherwise you wouldn't get the correct sub-man
page if you would run run-help on `btrfs files foo` for example.
Not an expert on btrfs I just stumbled on this while looking at some
btrfs issues.
Christian
> 2020/12/10 0:51, Christian K <syphdias@gmail.com> wrote:
>
> I'm sure there were some changes to btrfs subcommands in the meantime.
I believe the set of subcommands are quite stable in the case of btrfs
(btrfs-{image,map-logical} are independent commands).
But of course if subcommands are added/delteed we need to update
run-help-btrfs. Let us know if you notice any change.