Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📺 Add zsh completions #514

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

📺 Add zsh completions #514

wants to merge 1 commit into from

Conversation

Logicer16
Copy link

#222 has been open for over 5 years now (🥳 congrats). About time someone took care of it, especially as it's the default shell.

Closes #222

Please let me know of any questions/suggestions you might have.

contrib/completion/mas-completion.zsh Show resolved Hide resolved
contrib/completion/mas-completion.zsh Show resolved Hide resolved
contrib/completion/mas-completion.zsh Show resolved Hide resolved
contrib/completion/mas-completion.zsh Show resolved Hide resolved
contrib/completion/mas-completion.zsh Show resolved Hide resolved
'1:name:__mas_list_available' \
&& ret=0
;;
open)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern never matches because of a previous pattern on line 17.

contrib/completion/mas-completion.zsh Show resolved Hide resolved
contrib/completion/mas-completion.zsh Outdated Show resolved Hide resolved
contrib/completion/mas-completion.zsh Show resolved Hide resolved
contrib/completion/mas-completion.zsh Show resolved Hide resolved
@@ -0,0 +1,165 @@
#! /usr/bin/env zsh

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ShellCheck only supports sh/bash/dash/ksh scripts. Sorry!

@Logicer16
Copy link
Author

Let me know if any of these reviews are an actual concern as most aren't applicable.

}

__mas_search_names() {
[[ -z "$words[-1]" ]] && return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argument to -z is always false due to literal strings.

}

__mas_search_ids() {
[[ -z "$words[-1]" ]] && return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argument to -z is always false due to literal strings.

contrib/completion/mas-completion.zsh Show resolved Hide resolved
@Logicer16 Logicer16 force-pushed the main branch 2 times, most recently from c6db308 to 63d0fe8 Compare May 17, 2024 10:13

case "$state" in
args)
case $words[1] in

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet).

@@ -0,0 +1,166 @@
#compdef mas
# shellcheck shell=zsh

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shell type is unknown. Use e.g. sh or bash.

@Logicer16 Logicer16 marked this pull request as ready for review May 17, 2024 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📺 zsh command completion
2 participants