From 56fffd548203c3257d9fe05d75e36d8002b48bcc Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 31 May 2020 13:36:40 +0300 Subject: gitlab !14: modutils completion: Fix getting the value of kver from opt_args To get the _value_ of either of the options -S, -k or --set-version, the (i) subscript flag is not needed. --- Completion/Linux/Command/_modutils | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Completion/Linux/Command/_modutils') diff --git a/Completion/Linux/Command/_modutils b/Completion/Linux/Command/_modutils index ff6844f41..32cb49bd0 100644 --- a/Completion/Linux/Command/_modutils +++ b/Completion/Linux/Command/_modutils @@ -106,7 +106,7 @@ _modutils() { ;& all-modules) - local kver=${opt_args[(i)(-S|-k|--set-version)]:-$(uname -r)} + local kver=${opt_args[(-S|-k|--set-version)]:-$(uname -r)} if _cache_invalid modules-$kver || ! _retrieve_cache modules-$kver; then -- cgit v1.2.3 From aa7b62e3faca1fe0e6d47d6706280ff67694cff5 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 4 Jun 2020 20:48:17 +0300 Subject: gitlab !14 (fixup): modutils comp: Fix getting the value of kver from opt_args --- ChangeLog | 5 +++++ Completion/Linux/Command/_modutils | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Linux/Command/_modutils') diff --git a/ChangeLog b/ChangeLog index 9a421e418..42060024b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-06-08 Doron Behar + + * gitlab !14 (fixup): Completion/Linux/Command/_modutils: + modutils comp: Fix getting the value of kver from opt_args + 2020-06-07 Daniel Shahaf * 45932: Etc/FAQ.yo: FAQ (3.1): Update ksh compatibility answer diff --git a/Completion/Linux/Command/_modutils b/Completion/Linux/Command/_modutils index 32cb49bd0..cada38a16 100644 --- a/Completion/Linux/Command/_modutils +++ b/Completion/Linux/Command/_modutils @@ -106,7 +106,7 @@ _modutils() { ;& all-modules) - local kver=${opt_args[(-S|-k|--set-version)]:-$(uname -r)} + local kver=${(v)opt_args[(i)(-S|-k|--set-version)]:-$(uname -r)} if _cache_invalid modules-$kver || ! _retrieve_cache modules-$kver; then -- cgit v1.2.3 From 02f62e5d21e09d4936e18147119b1f0c85b93d79 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 31 May 2020 14:51:33 +0300 Subject: gitlab !15: modutils completion: Fix FHS assumption Remove calls to programs from /sbin/ with _call_program and to avoid the system complies to the FHS. Support modules completion for NixOS and Guix which store their kernel modules not at /lib/modules. --- ChangeLog | 3 +++ Completion/Linux/Command/_modutils | 23 ++++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'Completion/Linux/Command/_modutils') diff --git a/ChangeLog b/ChangeLog index 9ea9a1335..60333be4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2020-07-08 Oliver Kiddle + * gitlab !15: Doron Behar: Completion/Linux/Command/_modutils: + Fix FHS assumption + * 46201 (tweaked per Daniel): Etc/completion-style-guide: add guidelines for caching and use of imperative mood in descriptions diff --git a/Completion/Linux/Command/_modutils b/Completion/Linux/Command/_modutils index cada38a16..c62c6e7b6 100644 --- a/Completion/Linux/Command/_modutils +++ b/Completion/Linux/Command/_modutils @@ -12,7 +12,19 @@ _modules_caching_policy() _modutils() { local curcontext="$curcontext" expl state line modules modaliases ign args ret=1 local -A opt_args - local -r modules_dir=/lib/modules + local -a possible_modules_dirs=( + # Mostly every other distro + /lib/modules + # NixOS & possibly Guix + /run/booted-system/kernel-modules/lib/modules + ) + local modules_dir tested_modules_dir + for tested_modules_dir in "${possible_modules_dirs[@]}"; do + if [[ -d "$tested_modules_dir" ]]; then + modules_dir="$tested_modules_dir" + break + fi + done local update_policy zstyle -s ":completion:*:*:$service:*" cache-policy update_policy @@ -93,8 +105,10 @@ _modutils() { loaded-modules|loadable-modules) if [[ -r /proc/modules ]]; then loaded_modules=(${${(f)"$(/dev/null)"}:#parm:*}##parm:[[:space:]]##} ) + params=( ${${(M)${(f)"$(_call_program module-parameters modinfo "$words[2]" 2>/dev/null)"}:#parm:*}##parm:[[:space:]]##} ) compset -S '=*' if (( $#params )); then _values -S = -w 'module parameter' \ -- cgit v1.2.3 From d9e5ef02040d846a7b1ea1f7283f57152859bd6c Mon Sep 17 00:00:00 2001 From: Eric Cook Date: Mon, 19 Jul 2021 02:16:35 -0400 Subject: 49147: fix completion of linux kernel modules --- ChangeLog | 5 +++++ Completion/Linux/Command/_modutils | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Linux/Command/_modutils') diff --git a/ChangeLog b/ChangeLog index 2c988b4c8..dd5012fbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-07-19 Eric Cook + + * 49147: Completion/Linux/Command/_modutils: fix the completion + linux kernel modules + 2021-07-19 Jun-ichi Takimoto * 49166: Src/subst.c, Test/D04parameter.ztst: fix coredump in diff --git a/Completion/Linux/Command/_modutils b/Completion/Linux/Command/_modutils index c62c6e7b6..1205f2506 100644 --- a/Completion/Linux/Command/_modutils +++ b/Completion/Linux/Command/_modutils @@ -132,7 +132,7 @@ _modutils() { _store_cache modules-$kver modules modaliases fi - if (( ${+opt_args[(k)(-R|--resolve-alias)]} )); then + if [[ -v opt_args[(i)(-R|--resolve-alias)] ]]; then _tags module-aliases else _tags files modules module-aliases -- cgit v1.2.3 From 356dcb20cef387a5eea5f8fcbfe123b24e3bb928 Mon Sep 17 00:00:00 2001 From: Dimitris Apostolou Date: Fri, 12 Nov 2021 23:33:37 +0200 Subject: github #82: Fix typos --- ChangeLog | 11 +++++++++++ Completion/BSD/Command/_kdump | 2 +- Completion/BSD/Command/_ktrace | 2 +- Completion/Debian/Command/_aptitude | 2 +- Completion/Linux/Command/_modutils | 2 +- Completion/Linux/Command/_sysstat | 2 +- Completion/Mandriva/Command/_urpmi | 2 +- Completion/Redhat/Command/_dnf | 2 +- Completion/Unix/Command/_ansible | 2 +- Completion/Unix/Command/_gcc | 4 ++-- Etc/FAQ.yo | 4 ++-- Etc/NEWS-4.3 | 2 +- Functions/Chpwd/cdr | 2 +- Functions/Misc/regexp-replace | 2 +- Functions/Newuser/zsh-newuser-install | 2 +- NEWS | 2 +- Src/Zle/compmatch.c | 8 ++++---- Src/exec.c | 2 +- Src/math.c | 4 ++-- Test/A01grammar.ztst | 2 +- Test/B12limit.ztst | 2 +- 21 files changed, 37 insertions(+), 26 deletions(-) (limited to 'Completion/Linux/Command/_modutils') diff --git a/ChangeLog b/ChangeLog index de6bbb08b..1dfe2e39a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2021-11-12 Oliver Kiddle + * github #82: Dimitris Apostolou: Completion/BSD/Command/_kdump, + Completion/Redhat/Command/_dnf, Completion/BSD/Command/_ktrace, + Completion/Linux/Command/_modutils, Test/A01grammar.ztst, + Completion/Linux/Command/_sysstat, Functions/Chpwd/cdr, + Completion/Unix/Command/_ansible, Completion/Unix/Command/_gcc, + Completion/Mandriva/Command/_urpmi, Etc/NEWS-4.3, + Completion/Debian/Command/_aptitude, Etc/FAQ.yo, + Functions/Newuser/zsh-newuser-install, NEWS, + Functions/Misc/regexp-replace, Src/Zle/compmatch.c, + Src/exec.c, Src/math.c, Test/B12limit.ztst: fix typos + * Marlon: 49572: Completion/Base/Completer/_expand, Test/Y01completion.ztst: Let _expand preserve array form w/out zstyle glob diff --git a/Completion/BSD/Command/_kdump b/Completion/BSD/Command/_kdump index 946296a75..e5c7c4cce 100644 --- a/Completion/BSD/Command/_kdump +++ b/Completion/BSD/Command/_kdump @@ -30,7 +30,7 @@ local args=( '-f+[use the specified file (- for stdin)]:dump file:_files' '-l[loop reading the trace file]' '-m+[maximum I/O bytes to display]:max data bytes:' - '-n[supress ad hoc translations]' + '-n[suppress ad hoc translations]' '-p+[show output only for the specified pid]: :_kdump_pid' '(-E -T)-R[display relative timestamps]' '(-E -R )-T[display absolute timestamps]' diff --git a/Completion/BSD/Command/_ktrace b/Completion/BSD/Command/_ktrace index 13c11f15d..9613ba2bf 100644 --- a/Completion/BSD/Command/_ktrace +++ b/Completion/BSD/Command/_ktrace @@ -4,7 +4,7 @@ local args=( '-a[append to the trace file]' '(*)-C[disable tracing on all user owned processes or all processes if executed by root]' '-c[clear the trace points]' - '-d[trace current decendants]' + '-d[trace current descendants]' '-f+[log trace to specified file]:trace file:_files' '(-p *)-g+[enable/disable tracing on specified process group]:pgid:_pgids' '-i[inherit trace flags on future children]' diff --git a/Completion/Debian/Command/_aptitude b/Completion/Debian/Command/_aptitude index 91d233f11..5b10adb80 100644 --- a/Completion/Debian/Command/_aptitude +++ b/Completion/Debian/Command/_aptitude @@ -15,7 +15,7 @@ _arguments -C \ '(-F --display-format)'{-F,--display-format}'[specify output format for search command]:format:->format-strings' \ '--group-by=[control how the versions command groups its output]:grouping:(archive auto none package source-package source-version)' \ '--log-file=[specify output log file]:file:_files' \ - '*--log-level=[specify mimimum message level to log]:level:compadd -o nosort off fatal error warn info debug trace' \ + '*--log-level=[specify minimum message level to log]:level:compadd -o nosort off fatal error warn info debug trace' \ '--log-resolver[set some standard log levels related to the resolver]' \ '(--allow-new-installs)--no-new-installs[prevent safe-upgrade from installing any new packages]' \ '(--allow-new-upgrades)--no-new-upgrades[prevent safe-upgrade from upgrading packages regardless]' \ diff --git a/Completion/Linux/Command/_modutils b/Completion/Linux/Command/_modutils index 1205f2506..3e46130a2 100644 --- a/Completion/Linux/Command/_modutils +++ b/Completion/Linux/Command/_modutils @@ -105,7 +105,7 @@ _modutils() { loaded-modules|loadable-modules) if [[ -r /proc/modules ]]; then loaded_modules=(${${(f)"$(tp != CPAT_ANY || wp->tp != CPAT_ANY) @@ -1496,7 +1496,7 @@ pattern_match_restrict(Cpattern p, Cpattern wp, convchar_t *wsc, int wsclen, * characters. We're matching two patterns against * one another to generate a character to insert. * This is a bit too psychedelic, so I'm going to - * bale out now. See you on the ground. + * bail out now. See you on the ground. */ return 0; } @@ -1564,7 +1564,7 @@ pattern_match(Cpattern p, char *s, Cpattern wp, char *ws) c = unmeta_one(s, &len); /* * If either is "?", they match each other; no further tests. - * Apply this even if the character wasn't convertable; + * Apply this even if the character wasn't convertible; * there's no point trying to be clever in that case. */ if (p->tp != CPAT_ANY || wp->tp != CPAT_ANY) @@ -1934,7 +1934,7 @@ bld_line(Cmatcher mp, ZLE_STRING_T line, char *mword, char *word, * This is the nightmare case: we have line and * and word matchers and some pattern which restricts * the value on the line without us knowing exactly - * what it is. Despatch to the special function + * what it is. Dispatch to the special function * for that. */ if (mp && !mp->flags && mp->wlen <= wlen && diff --git a/Src/exec.c b/Src/exec.c index 1f23a862d..1860a10ed 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -3954,7 +3954,7 @@ execcmd_exec(Estate state, Execcmd_params eparams, if (type == WC_AUTOFN) { /* * We pre-loaded this to get any redirs. - * So we execuate a simplified function here. + * So we execute a simplified function here. */ lastval = execautofn_basic(state, do_exec); } else diff --git a/Src/math.c b/Src/math.c index ade02d80c..4f24361a4 100644 --- a/Src/math.c +++ b/Src/math.c @@ -162,7 +162,7 @@ static int unary = 1; #define TOKCOUNT 53 /* - * Opeator recedences: in reverse order, i.e. lower number, high precedence. + * Operator precedences: in reverse order, i.e. lower number, high precedence. * These are the C precedences. * * 0 Non-operators: NUM (numeric constant), ID (identifier), @@ -219,7 +219,7 @@ static int c_prec[TOKCOUNT] = }; /* - * Opeator recedences: in reverse order, i.e. lower number, high precedence. + * Operator precedences: in reverse order, i.e. lower number, high precedence. * These are the default zsh precedences. * * 0 Non-operators: NUM (numeric constant), ID (identifier), diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst index c114ff103..ac39a4eea 100644 --- a/Test/A01grammar.ztst +++ b/Test/A01grammar.ztst @@ -922,7 +922,7 @@ F:Note that the behaviour of 'exit' inside try-list inside a function is unspeci x=1 x=2 | echo $x echo $x -0:Assignment-only current shell commands in LHS of pipelin +0:Assignment-only current shell commands in LHS of pipeline >1 >1 diff --git a/Test/B12limit.ztst b/Test/B12limit.ztst index 48d33e6e3..9dce59824 100644 --- a/Test/B12limit.ztst +++ b/Test/B12limit.ztst @@ -11,7 +11,7 @@ %test limit | grep UNKNOWN || print OK -0:Check if there is unknown resouce(s) in the system +0:Check if there is unknown resource(s) in the system >OK F:A failure here does not indicate any error in zsh. It just means there F:is a resource in your system that is unknown to zsh developers. Please -- cgit v1.2.3