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

fix: optimize and re-format usage message #534

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

Conversation

vladdoster
Copy link
Member

@vladdoster vladdoster commented Jun 6, 2023

Description

  • fix zinit --help
  • format available ices and move to ice command usage.
  • check for -h|--help|help first instead of last
  • add --help to ice command
  • update zinit usage message
  • remove deprecated commands (e.g., list, clist, ls)

Related Issue(s)

N/A

Motivation and Context

Usage examples

before

Screenshot 2023-06-05 at 20 21 42 Screenshot 2023-06-05 at 20 24 33 Screenshot 2023-06-05 at 20 21 17

after

Screenshot 2023-06-05 at 20 19 44 Screenshot 2023-06-05 at 20 25 24 Screenshot 2023-06-05 at 20 19 59

How Has This Been Tested?

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bug fix (non-breaking change which fixes an issue)
  • Documentation change
  • New feature (non-breaking change which adds functionality)

Checklist:

  • All new and existing tests passed.
  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.

Copy link
Member

@pschmitt pschmitt left a comment

Choose a reason for hiding this comment

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

🤔
Should it be Zinit or zinit?

Is it Zsh, zsh, or ZSH?

zinit-autoload.zsh Outdated Show resolved Hide resolved
Makefile Outdated
Comment on lines 21 to 49
# Run ctags to generate Emacs and Vim's format tag file.
tags: tags/emacs tags/vim

tags/emacs: ## Build Emacs-style ctags file
@if type ctags >/dev/null 2>&1; then \
if ctags --version | grep >/dev/null 2>&1 "Universal Ctags"; then \
ctags -e -R --options=share/zsh.ctags --languages=zsh \
--pattern-length-limit=250 --maxdepth=1; \
else \
ctags -e -R --languages=sh --langmap=sh:.zsh; \
fi; \
printf "Created the Emacs \`TAGS\` file.\\n"; \
else \
printf 'Error: Please install a Ctags (e.g.: either the Exuberant or Universal %b' \
'version) utility first.\n'; \
fi

tags/vim: ## Build the Vim-style ctags file
@if type ctags >/dev/null 2>&1; then \
if ctags --version | grep >/dev/null 2>&1 "Universal Ctags"; then \
ctags --languages=zsh --maxdepth=1 --options=share/zsh.ctags --pattern-length-limit=250 -R; \
else \
ctags -R --languages=sh --langmap=sh:.zsh; \
fi; \
printf "Created the Vim's style \`tags\` file.\\n"; \
else \
printf 'Error: Please install a ctags first.\n'; \
fi

Copy link
Member

Choose a reason for hiding this comment

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

Seems unrelated.

Copy link
Member Author

@vladdoster vladdoster Jun 16, 2023

Choose a reason for hiding this comment

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

@pschmitt,

Good catch. Due to the conversation in #482, I'm going to purge zi-browse-symbols & ctags related code in a separate PR.

- lists available ices via `zi ice [-h/-help]`
- remove verbiage in `zi help` to improve readability
- fix broken formatting of `times` in `zi help`
- sort commands alphabetically in `zi help` message

Signed-off-by: Doster, Vladislav <[email protected]>
@vladdoster
Copy link
Member Author

Current format is on the left and new on right.
Screenshot 2023-06-15 at 21 29 30

Comment on lines -54 to -63
@test 'completions-ignored' {
# only the _valid file should be installed as a completion
run zinit as"null" id-as"test/ignored_completions" atclone"touch __init__.py _valid" completions for zdharma-continuum/null
assert $state equals 0
assert "$ZPLUGINS/test---ignored_completions/_valid" is_file
assert "$ZPLUGINS/test---ignored_completions/__init__.py" is_file
assert "$ZINIT[COMPLETIONS_DIR]/_valid" is_file
COMPS=( "$ZINIT[COMPLETIONS_DIR]"/_* )
assert __init__.py is_not_value_in $COMPS
}
Copy link
Member

Choose a reason for hiding this comment

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

@vladdoster please re-add that :)
This is from #528

Copy link
Member

Choose a reason for hiding this comment

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

Did you rebase on an old version of main perhaps?

Comment on lines -557 to +553
completions=( "${plugin}"/**/_[^_.]*~*(*.zwc|*.html|*.txt|*.png|*.jpg|*.jpeg|*.js|*.md|*.yml|*.yaml|*.py|*.ri|_zsh_highlight*|/zsdoc/*|*.ps1)(DN^/) ) || \
completions=( "${ZINIT[PLUGINS_DIR]}/${id_as//\//---}"/**/_[^_.]*~*(*.zwc|*.html|*.txt|*.png|*.jpg|*.jpeg|*.js|*.md|*.yml|*.yaml|*.py|*.ri|_zsh_highlight*|/zsdoc/*|*.ps1)(DN^/) )
completions=( "${plugin}"/**/_[^_.]*~*(*.zwc|*.html|*.txt|*.png|*.jpg|*.jpeg|*.js|*.md|*.yml|*.ri|_zsh_highlight*|/zsdoc/*|*.ps1)(DN^/) ) || \
completions=( "${ZINIT[PLUGINS_DIR]}/${id_as//\//---}"/**/_[^_.]*~*(*.zwc|*.html|*.txt|*.png|*.jpg|*.jpeg|*.js|*.md|*.yml|*.ri|_zsh_highlight*|/zsdoc/*|*.ps1)(DN^/) )
Copy link
Member

Choose a reason for hiding this comment

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

SAme here. This is from PR #528

Copy link
Member

@pschmitt pschmitt left a comment

Choose a reason for hiding this comment

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

Please rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants