From f98ba1737f5b96a3ceadc5ecb9f8cdca661d64ea Mon Sep 17 00:00:00 2001 From: saying121 Date: Sun, 28 Apr 2024 22:57:21 +0800 Subject: [PATCH] ci(release): gen completions and add completions --- .github/workflows/release.yml | 14 + README.md | 4 + completions/_lcode | 607 +++++++++++++++++++++++++++ completions/lcode.bash | 760 ++++++++++++++++++++++++++++++++++ completions/lcode.fish | 65 +++ 5 files changed, 1450 insertions(+) create mode 100644 completions/_lcode create mode 100644 completions/lcode.bash create mode 100644 completions/lcode.fish diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4861f34..7877137 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -188,3 +188,17 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} # ref: refs/tags/${{ needs.get-version.outputs.tag_version }} checksum: sha256 + + - name: Generate completions + if: ${{ matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64-unknown-linux-gnu' }} + run: | + ./target/x86_64-unknown-linux-gnu/release/lcode --generate=zsh | tee ./completions/_lcode + ./target/x86_64-unknown-linux-gnu/release/lcode --generate=bash | tee ./completions/lcode.bash + ./target/x86_64-unknown-linux-gnu/release/lcode --generate=fish | tee ./completions/lcode.fish + + git config user.email "actions@github" + git config user.name "Github Actions" + git remote set-url origin https://x-access-token:"${GITHUB_TOKEN}"@github.com/"${GITHUB_REPOSITORY}".git + git add completions/ + # shellcheck disable=SC2015 + git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:"${GITHUB_REF}") diff --git a/README.md b/README.md index d96f4c1..3b7c227 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,10 @@ echo 'eval $(lcode --generate zsh)' >>~/.zshrc echo 'eval $(lcode --generate bash)' >>~/.bashrc # ... ``` + + + + ## 📼Videos diff --git a/completions/_lcode b/completions/_lcode new file mode 100644 index 0000000..f600db6 --- /dev/null +++ b/completions/_lcode @@ -0,0 +1,607 @@ +#compdef lcode + +autoload -U is-at-least + +_lcode() { + typeset -A opt_args + typeset -a _arguments_options + local ret=1 + + if is-at-least 5.2; then + _arguments_options=(-s -S -C) + else + _arguments_options=(-s -C) + fi + + local context curcontext="$curcontext" state line + _arguments "${_arguments_options[@]}" \ +'--generate=[]:GENERATOR:(bash elvish fish powershell zsh)' \ +'-h[Print help]' \ +'--help[Print help]' \ +'-V[Print version]' \ +'--version[Print version]' \ +":: :_lcode_commands" \ +"*::: :->lcode" \ +&& ret=0 + case $state in + (lcode) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:lcode-command-$line[1]:" + case $line[1] in + (edit) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +':input -- Question id:' \ +":: :_lcode__edit_commands" \ +"*::: :->edit" \ +&& ret=0 + + case $state in + (edit) + words=($line[2] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:lcode-edit-command-$line[2]:" + case $line[2] in + (code) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +':input -- Question id:' \ +&& ret=0 +;; +(test) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +':input -- Question id:' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_lcode__edit__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:lcode-edit-help-command-$line[1]:" + case $line[1] in + (code) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(test) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(fzy) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +":: :_lcode__fzy_commands" \ +"*::: :->fzy" \ +&& ret=0 + + case $state in + (fzy) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:lcode-fzy-command-$line[1]:" + case $line[1] in + (detail) +_arguments "${_arguments_options[@]}" \ +'-f[Force update question'\''s information]' \ +'--force[Force update question'\''s information]' \ +'-h[Print help]' \ +'--help[Print help]' \ +':id -- Force update question'\''s information:' \ +&& ret=0 +;; +(edit) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_lcode__fzy__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:lcode-fzy-help-command-$line[1]:" + case $line[1] in + (detail) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(edit) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +;; +(detail) +_arguments "${_arguments_options[@]}" \ +'-f[Force update question'\''s information]' \ +'--force[Force update question'\''s information]' \ +'-h[Print help]' \ +'--help[Print help]' \ +':id -- Force update question'\''s information:' \ +&& ret=0 +;; +(sync) +_arguments "${_arguments_options[@]}" \ +'-f[Delete database for full re-sync]' \ +'--force[Delete database for full re-sync]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(test) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +':id:' \ +&& ret=0 +;; +(submit) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +':id:' \ +&& ret=0 +;; +(sublist) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +':id:' \ +&& ret=0 +;; +(gencon) +_arguments "${_arguments_options[@]}" \ +'-c[]' \ +'--cn[]' \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(tui) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(config) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(log) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(star) +_arguments "${_arguments_options[@]}" \ +'-h[Print help]' \ +'--help[Print help]' \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +":: :_lcode__help_commands" \ +"*::: :->help" \ +&& ret=0 + + case $state in + (help) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:lcode-help-command-$line[1]:" + case $line[1] in + (edit) +_arguments "${_arguments_options[@]}" \ +":: :_lcode__help__edit_commands" \ +"*::: :->edit" \ +&& ret=0 + + case $state in + (edit) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:lcode-help-edit-command-$line[1]:" + case $line[1] in + (code) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(test) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; +(fzy) +_arguments "${_arguments_options[@]}" \ +":: :_lcode__help__fzy_commands" \ +"*::: :->fzy" \ +&& ret=0 + + case $state in + (fzy) + words=($line[1] "${words[@]}") + (( CURRENT += 1 )) + curcontext="${curcontext%:*:*}:lcode-help-fzy-command-$line[1]:" + case $line[1] in + (detail) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(edit) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; +(detail) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(sync) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(test) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(submit) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(sublist) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(gencon) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(tui) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(config) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(log) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(star) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; +(help) +_arguments "${_arguments_options[@]}" \ +&& ret=0 +;; + esac + ;; +esac +;; + esac + ;; +esac +} + +(( $+functions[_lcode_commands] )) || +_lcode_commands() { + local commands; commands=( +'edit:Edit \`code\` or \`test cases\`, default edit \`code\` \[ alias\: e \]' \ +'fzy:Interact select a question (fuzzy search), default view detail \[ alias\: f \]' \ +'detail:View a question detail \[ alias\: D \]' \ +'sync:Syncanhronize leetcode info \[ alias\: S \]' \ +'test:Test your code \[ alias\: t \]' \ +'submit:Submit your code \[ alias\: st \]' \ +'sublist:Get submit list \[ alias\: sl \]' \ +'gencon:Generate a config, will also be automatically generated at runtime \[ alias\: g \]' \ +'tui:Open Tui \[ alias\: T \]' \ +'config:Edit config \[ alias\: C \]' \ +'log:Open Log \[ alias\: L \]' \ +'star:Give the project a star' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'lcode commands' commands "$@" +} +(( $+functions[_lcode__edit__code_commands] )) || +_lcode__edit__code_commands() { + local commands; commands=() + _describe -t commands 'lcode edit code commands' commands "$@" +} +(( $+functions[_lcode__edit__help__code_commands] )) || +_lcode__edit__help__code_commands() { + local commands; commands=() + _describe -t commands 'lcode edit help code commands' commands "$@" +} +(( $+functions[_lcode__help__edit__code_commands] )) || +_lcode__help__edit__code_commands() { + local commands; commands=() + _describe -t commands 'lcode help edit code commands' commands "$@" +} +(( $+functions[_lcode__config_commands] )) || +_lcode__config_commands() { + local commands; commands=() + _describe -t commands 'lcode config commands' commands "$@" +} +(( $+functions[_lcode__help__config_commands] )) || +_lcode__help__config_commands() { + local commands; commands=() + _describe -t commands 'lcode help config commands' commands "$@" +} +(( $+functions[_lcode__detail_commands] )) || +_lcode__detail_commands() { + local commands; commands=() + _describe -t commands 'lcode detail commands' commands "$@" +} +(( $+functions[_lcode__fzy__detail_commands] )) || +_lcode__fzy__detail_commands() { + local commands; commands=() + _describe -t commands 'lcode fzy detail commands' commands "$@" +} +(( $+functions[_lcode__fzy__help__detail_commands] )) || +_lcode__fzy__help__detail_commands() { + local commands; commands=() + _describe -t commands 'lcode fzy help detail commands' commands "$@" +} +(( $+functions[_lcode__help__detail_commands] )) || +_lcode__help__detail_commands() { + local commands; commands=() + _describe -t commands 'lcode help detail commands' commands "$@" +} +(( $+functions[_lcode__help__fzy__detail_commands] )) || +_lcode__help__fzy__detail_commands() { + local commands; commands=() + _describe -t commands 'lcode help fzy detail commands' commands "$@" +} +(( $+functions[_lcode__edit_commands] )) || +_lcode__edit_commands() { + local commands; commands=( +'code:Edit code(default)' \ +'test:Edit test case' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'lcode edit commands' commands "$@" +} +(( $+functions[_lcode__fzy__edit_commands] )) || +_lcode__fzy__edit_commands() { + local commands; commands=() + _describe -t commands 'lcode fzy edit commands' commands "$@" +} +(( $+functions[_lcode__fzy__help__edit_commands] )) || +_lcode__fzy__help__edit_commands() { + local commands; commands=() + _describe -t commands 'lcode fzy help edit commands' commands "$@" +} +(( $+functions[_lcode__help__edit_commands] )) || +_lcode__help__edit_commands() { + local commands; commands=( +'code:Edit code(default)' \ +'test:Edit test case' \ + ) + _describe -t commands 'lcode help edit commands' commands "$@" +} +(( $+functions[_lcode__help__fzy__edit_commands] )) || +_lcode__help__fzy__edit_commands() { + local commands; commands=() + _describe -t commands 'lcode help fzy edit commands' commands "$@" +} +(( $+functions[_lcode__fzy_commands] )) || +_lcode__fzy_commands() { + local commands; commands=( +'detail:View detail' \ +'edit:Edit code' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'lcode fzy commands' commands "$@" +} +(( $+functions[_lcode__help__fzy_commands] )) || +_lcode__help__fzy_commands() { + local commands; commands=( +'detail:View detail' \ +'edit:Edit code' \ + ) + _describe -t commands 'lcode help fzy commands' commands "$@" +} +(( $+functions[_lcode__gencon_commands] )) || +_lcode__gencon_commands() { + local commands; commands=() + _describe -t commands 'lcode gencon commands' commands "$@" +} +(( $+functions[_lcode__help__gencon_commands] )) || +_lcode__help__gencon_commands() { + local commands; commands=() + _describe -t commands 'lcode help gencon commands' commands "$@" +} +(( $+functions[_lcode__edit__help_commands] )) || +_lcode__edit__help_commands() { + local commands; commands=( +'code:Edit code(default)' \ +'test:Edit test case' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'lcode edit help commands' commands "$@" +} +(( $+functions[_lcode__edit__help__help_commands] )) || +_lcode__edit__help__help_commands() { + local commands; commands=() + _describe -t commands 'lcode edit help help commands' commands "$@" +} +(( $+functions[_lcode__fzy__help_commands] )) || +_lcode__fzy__help_commands() { + local commands; commands=( +'detail:View detail' \ +'edit:Edit code' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'lcode fzy help commands' commands "$@" +} +(( $+functions[_lcode__fzy__help__help_commands] )) || +_lcode__fzy__help__help_commands() { + local commands; commands=() + _describe -t commands 'lcode fzy help help commands' commands "$@" +} +(( $+functions[_lcode__help_commands] )) || +_lcode__help_commands() { + local commands; commands=( +'edit:Edit \`code\` or \`test cases\`, default edit \`code\` \[ alias\: e \]' \ +'fzy:Interact select a question (fuzzy search), default view detail \[ alias\: f \]' \ +'detail:View a question detail \[ alias\: D \]' \ +'sync:Syncanhronize leetcode info \[ alias\: S \]' \ +'test:Test your code \[ alias\: t \]' \ +'submit:Submit your code \[ alias\: st \]' \ +'sublist:Get submit list \[ alias\: sl \]' \ +'gencon:Generate a config, will also be automatically generated at runtime \[ alias\: g \]' \ +'tui:Open Tui \[ alias\: T \]' \ +'config:Edit config \[ alias\: C \]' \ +'log:Open Log \[ alias\: L \]' \ +'star:Give the project a star' \ +'help:Print this message or the help of the given subcommand(s)' \ + ) + _describe -t commands 'lcode help commands' commands "$@" +} +(( $+functions[_lcode__help__help_commands] )) || +_lcode__help__help_commands() { + local commands; commands=() + _describe -t commands 'lcode help help commands' commands "$@" +} +(( $+functions[_lcode__help__log_commands] )) || +_lcode__help__log_commands() { + local commands; commands=() + _describe -t commands 'lcode help log commands' commands "$@" +} +(( $+functions[_lcode__log_commands] )) || +_lcode__log_commands() { + local commands; commands=() + _describe -t commands 'lcode log commands' commands "$@" +} +(( $+functions[_lcode__help__star_commands] )) || +_lcode__help__star_commands() { + local commands; commands=() + _describe -t commands 'lcode help star commands' commands "$@" +} +(( $+functions[_lcode__star_commands] )) || +_lcode__star_commands() { + local commands; commands=() + _describe -t commands 'lcode star commands' commands "$@" +} +(( $+functions[_lcode__help__sublist_commands] )) || +_lcode__help__sublist_commands() { + local commands; commands=() + _describe -t commands 'lcode help sublist commands' commands "$@" +} +(( $+functions[_lcode__sublist_commands] )) || +_lcode__sublist_commands() { + local commands; commands=() + _describe -t commands 'lcode sublist commands' commands "$@" +} +(( $+functions[_lcode__help__submit_commands] )) || +_lcode__help__submit_commands() { + local commands; commands=() + _describe -t commands 'lcode help submit commands' commands "$@" +} +(( $+functions[_lcode__submit_commands] )) || +_lcode__submit_commands() { + local commands; commands=() + _describe -t commands 'lcode submit commands' commands "$@" +} +(( $+functions[_lcode__help__sync_commands] )) || +_lcode__help__sync_commands() { + local commands; commands=() + _describe -t commands 'lcode help sync commands' commands "$@" +} +(( $+functions[_lcode__sync_commands] )) || +_lcode__sync_commands() { + local commands; commands=() + _describe -t commands 'lcode sync commands' commands "$@" +} +(( $+functions[_lcode__edit__help__test_commands] )) || +_lcode__edit__help__test_commands() { + local commands; commands=() + _describe -t commands 'lcode edit help test commands' commands "$@" +} +(( $+functions[_lcode__edit__test_commands] )) || +_lcode__edit__test_commands() { + local commands; commands=() + _describe -t commands 'lcode edit test commands' commands "$@" +} +(( $+functions[_lcode__help__edit__test_commands] )) || +_lcode__help__edit__test_commands() { + local commands; commands=() + _describe -t commands 'lcode help edit test commands' commands "$@" +} +(( $+functions[_lcode__help__test_commands] )) || +_lcode__help__test_commands() { + local commands; commands=() + _describe -t commands 'lcode help test commands' commands "$@" +} +(( $+functions[_lcode__test_commands] )) || +_lcode__test_commands() { + local commands; commands=() + _describe -t commands 'lcode test commands' commands "$@" +} +(( $+functions[_lcode__help__tui_commands] )) || +_lcode__help__tui_commands() { + local commands; commands=() + _describe -t commands 'lcode help tui commands' commands "$@" +} +(( $+functions[_lcode__tui_commands] )) || +_lcode__tui_commands() { + local commands; commands=() + _describe -t commands 'lcode tui commands' commands "$@" +} + +if [ "$funcstack[1]" = "_lcode" ]; then + _lcode "$@" +else + compdef _lcode lcode +fi diff --git a/completions/lcode.bash b/completions/lcode.bash new file mode 100644 index 0000000..d5f6ca2 --- /dev/null +++ b/completions/lcode.bash @@ -0,0 +1,760 @@ +_lcode() { + local i cur prev opts cmd + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + cmd="" + opts="" + + for i in ${COMP_WORDS[@]} + do + case "${cmd},${i}" in + ",$1") + cmd="lcode" + ;; + lcode,config) + cmd="lcode__config" + ;; + lcode,detail) + cmd="lcode__detail" + ;; + lcode,edit) + cmd="lcode__edit" + ;; + lcode,fzy) + cmd="lcode__fzy" + ;; + lcode,gencon) + cmd="lcode__gencon" + ;; + lcode,help) + cmd="lcode__help" + ;; + lcode,log) + cmd="lcode__log" + ;; + lcode,star) + cmd="lcode__star" + ;; + lcode,sublist) + cmd="lcode__sublist" + ;; + lcode,submit) + cmd="lcode__submit" + ;; + lcode,sync) + cmd="lcode__sync" + ;; + lcode,test) + cmd="lcode__test" + ;; + lcode,tui) + cmd="lcode__tui" + ;; + lcode__edit,code) + cmd="lcode__edit__code" + ;; + lcode__edit,help) + cmd="lcode__edit__help" + ;; + lcode__edit,test) + cmd="lcode__edit__test" + ;; + lcode__edit__help,code) + cmd="lcode__edit__help__code" + ;; + lcode__edit__help,help) + cmd="lcode__edit__help__help" + ;; + lcode__edit__help,test) + cmd="lcode__edit__help__test" + ;; + lcode__fzy,detail) + cmd="lcode__fzy__detail" + ;; + lcode__fzy,edit) + cmd="lcode__fzy__edit" + ;; + lcode__fzy,help) + cmd="lcode__fzy__help" + ;; + lcode__fzy__help,detail) + cmd="lcode__fzy__help__detail" + ;; + lcode__fzy__help,edit) + cmd="lcode__fzy__help__edit" + ;; + lcode__fzy__help,help) + cmd="lcode__fzy__help__help" + ;; + lcode__help,config) + cmd="lcode__help__config" + ;; + lcode__help,detail) + cmd="lcode__help__detail" + ;; + lcode__help,edit) + cmd="lcode__help__edit" + ;; + lcode__help,fzy) + cmd="lcode__help__fzy" + ;; + lcode__help,gencon) + cmd="lcode__help__gencon" + ;; + lcode__help,help) + cmd="lcode__help__help" + ;; + lcode__help,log) + cmd="lcode__help__log" + ;; + lcode__help,star) + cmd="lcode__help__star" + ;; + lcode__help,sublist) + cmd="lcode__help__sublist" + ;; + lcode__help,submit) + cmd="lcode__help__submit" + ;; + lcode__help,sync) + cmd="lcode__help__sync" + ;; + lcode__help,test) + cmd="lcode__help__test" + ;; + lcode__help,tui) + cmd="lcode__help__tui" + ;; + lcode__help__edit,code) + cmd="lcode__help__edit__code" + ;; + lcode__help__edit,test) + cmd="lcode__help__edit__test" + ;; + lcode__help__fzy,detail) + cmd="lcode__help__fzy__detail" + ;; + lcode__help__fzy,edit) + cmd="lcode__help__fzy__edit" + ;; + *) + ;; + esac + done + + case "${cmd}" in + lcode) + opts="-h -V --generate --help --version edit fzy detail sync test submit sublist gencon tui config log star help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + --generate) + COMPREPLY=($(compgen -W "bash elvish fish powershell zsh" -- "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__config) + opts="-h --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__detail) + opts="-f -h --force --help " + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__edit) + opts="-h --help code test help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__edit__code) + opts="-h --help " + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__edit__help) + opts="code test help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__edit__help__code) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__edit__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__edit__help__test) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__edit__test) + opts="-h --help " + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__fzy) + opts="-h --help detail edit help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__fzy__detail) + opts="-f -h --force --help " + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__fzy__edit) + opts="-h --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__fzy__help) + opts="detail edit help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__fzy__help__detail) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__fzy__help__edit) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__fzy__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__gencon) + opts="-c -h --cn --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help) + opts="edit fzy detail sync test submit sublist gencon tui config log star help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__config) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__detail) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__edit) + opts="code test" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__edit__code) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__edit__test) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__fzy) + opts="detail edit" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__fzy__detail) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__fzy__edit) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__gencon) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__help) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__log) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__star) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__sublist) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__submit) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__sync) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__test) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__help__tui) + opts="" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__log) + opts="-h --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__star) + opts="-h --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__sublist) + opts="-h --help " + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__submit) + opts="-h --help " + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__sync) + opts="-f -h --force --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__test) + opts="-h --help " + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + lcode__tui) + opts="-h --help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + esac +} + +if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then + complete -F _lcode -o nosort -o bashdefault -o default lcode +else + complete -F _lcode -o bashdefault -o default lcode +fi diff --git a/completions/lcode.fish b/completions/lcode.fish new file mode 100644 index 0000000..8d3e4be --- /dev/null +++ b/completions/lcode.fish @@ -0,0 +1,65 @@ +complete -c lcode -n "__fish_use_subcommand" -l generate -r -f -a "{bash '',elvish '',fish '',powershell '',zsh ''}" +complete -c lcode -n "__fish_use_subcommand" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_use_subcommand" -s V -l version -d 'Print version' +complete -c lcode -n "__fish_use_subcommand" -f -a "edit" -d 'Edit `code` or `test cases`, default edit `code` [ alias: e ]' +complete -c lcode -n "__fish_use_subcommand" -f -a "fzy" -d 'Interact select a question (fuzzy search), default view detail [ alias: f ]' +complete -c lcode -n "__fish_use_subcommand" -f -a "detail" -d 'View a question detail [ alias: D ]' +complete -c lcode -n "__fish_use_subcommand" -f -a "sync" -d 'Syncanhronize leetcode info [ alias: S ]' +complete -c lcode -n "__fish_use_subcommand" -f -a "test" -d 'Test your code [ alias: t ]' +complete -c lcode -n "__fish_use_subcommand" -f -a "submit" -d 'Submit your code [ alias: st ]' +complete -c lcode -n "__fish_use_subcommand" -f -a "sublist" -d 'Get submit list [ alias: sl ]' +complete -c lcode -n "__fish_use_subcommand" -f -a "gencon" -d 'Generate a config, will also be automatically generated at runtime [ alias: g ]' +complete -c lcode -n "__fish_use_subcommand" -f -a "tui" -d 'Open Tui [ alias: T ]' +complete -c lcode -n "__fish_use_subcommand" -f -a "config" -d 'Edit config [ alias: C ]' +complete -c lcode -n "__fish_use_subcommand" -f -a "log" -d 'Open Log [ alias: L ]' +complete -c lcode -n "__fish_use_subcommand" -f -a "star" -d 'Give the project a star' +complete -c lcode -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c lcode -n "__fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from code; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from help" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from code; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from help" -f -a "code" -d 'Edit code(default)' +complete -c lcode -n "__fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from code; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from help" -f -a "test" -d 'Edit test case' +complete -c lcode -n "__fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from code; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c lcode -n "__fish_seen_subcommand_from edit; and __fish_seen_subcommand_from code" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from edit; and __fish_seen_subcommand_from test" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from edit; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from code; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from help" -f -a "code" -d 'Edit code(default)' +complete -c lcode -n "__fish_seen_subcommand_from edit; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from code; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from help" -f -a "test" -d 'Edit test case' +complete -c lcode -n "__fish_seen_subcommand_from edit; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from code; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c lcode -n "__fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from help" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from help" -f -a "detail" -d 'View detail' +complete -c lcode -n "__fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from help" -f -a "edit" -d 'Edit code' +complete -c lcode -n "__fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c lcode -n "__fish_seen_subcommand_from fzy; and __fish_seen_subcommand_from detail" -s f -l force -d 'Force update question\'s information' +complete -c lcode -n "__fish_seen_subcommand_from fzy; and __fish_seen_subcommand_from detail" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from fzy; and __fish_seen_subcommand_from edit" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from fzy; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from help" -f -a "detail" -d 'View detail' +complete -c lcode -n "__fish_seen_subcommand_from fzy; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from help" -f -a "edit" -d 'Edit code' +complete -c lcode -n "__fish_seen_subcommand_from fzy; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c lcode -n "__fish_seen_subcommand_from detail" -s f -l force -d 'Force update question\'s information' +complete -c lcode -n "__fish_seen_subcommand_from detail" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from sync" -s f -l force -d 'Delete database for full re-sync' +complete -c lcode -n "__fish_seen_subcommand_from sync" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from test" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from submit" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from sublist" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from gencon" -s c -l cn +complete -c lcode -n "__fish_seen_subcommand_from gencon" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from tui" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from config" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from log" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from star" -s h -l help -d 'Print help' +complete -c lcode -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from sync; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from submit; and not __fish_seen_subcommand_from sublist; and not __fish_seen_subcommand_from gencon; and not __fish_seen_subcommand_from tui; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from log; and not __fish_seen_subcommand_from star; and not __fish_seen_subcommand_from help" -f -a "edit" -d 'Edit `code` or `test cases`, default edit `code` [ alias: e ]' +complete -c lcode -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from sync; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from submit; and not __fish_seen_subcommand_from sublist; and not __fish_seen_subcommand_from gencon; and not __fish_seen_subcommand_from tui; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from log; and not __fish_seen_subcommand_from star; and not __fish_seen_subcommand_from help" -f -a "fzy" -d 'Interact select a question (fuzzy search), default view detail [ alias: f ]' +complete -c lcode -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from sync; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from submit; and not __fish_seen_subcommand_from sublist; and not __fish_seen_subcommand_from gencon; and not __fish_seen_subcommand_from tui; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from log; and not __fish_seen_subcommand_from star; and not __fish_seen_subcommand_from help" -f -a "detail" -d 'View a question detail [ alias: D ]' +complete -c lcode -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from sync; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from submit; and not __fish_seen_subcommand_from sublist; and not __fish_seen_subcommand_from gencon; and not __fish_seen_subcommand_from tui; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from log; and not __fish_seen_subcommand_from star; and not __fish_seen_subcommand_from help" -f -a "sync" -d 'Syncanhronize leetcode info [ alias: S ]' +complete -c lcode -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from sync; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from submit; and not __fish_seen_subcommand_from sublist; and not __fish_seen_subcommand_from gencon; and not __fish_seen_subcommand_from tui; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from log; and not __fish_seen_subcommand_from star; and not __fish_seen_subcommand_from help" -f -a "test" -d 'Test your code [ alias: t ]' +complete -c lcode -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from sync; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from submit; and not __fish_seen_subcommand_from sublist; and not __fish_seen_subcommand_from gencon; and not __fish_seen_subcommand_from tui; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from log; and not __fish_seen_subcommand_from star; and not __fish_seen_subcommand_from help" -f -a "submit" -d 'Submit your code [ alias: st ]' +complete -c lcode -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from sync; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from submit; and not __fish_seen_subcommand_from sublist; and not __fish_seen_subcommand_from gencon; and not __fish_seen_subcommand_from tui; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from log; and not __fish_seen_subcommand_from star; and not __fish_seen_subcommand_from help" -f -a "sublist" -d 'Get submit list [ alias: sl ]' +complete -c lcode -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from sync; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from submit; and not __fish_seen_subcommand_from sublist; and not __fish_seen_subcommand_from gencon; and not __fish_seen_subcommand_from tui; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from log; and not __fish_seen_subcommand_from star; and not __fish_seen_subcommand_from help" -f -a "gencon" -d 'Generate a config, will also be automatically generated at runtime [ alias: g ]' +complete -c lcode -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from sync; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from submit; and not __fish_seen_subcommand_from sublist; and not __fish_seen_subcommand_from gencon; and not __fish_seen_subcommand_from tui; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from log; and not __fish_seen_subcommand_from star; and not __fish_seen_subcommand_from help" -f -a "tui" -d 'Open Tui [ alias: T ]' +complete -c lcode -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from sync; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from submit; and not __fish_seen_subcommand_from sublist; and not __fish_seen_subcommand_from gencon; and not __fish_seen_subcommand_from tui; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from log; and not __fish_seen_subcommand_from star; and not __fish_seen_subcommand_from help" -f -a "config" -d 'Edit config [ alias: C ]' +complete -c lcode -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from sync; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from submit; and not __fish_seen_subcommand_from sublist; and not __fish_seen_subcommand_from gencon; and not __fish_seen_subcommand_from tui; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from log; and not __fish_seen_subcommand_from star; and not __fish_seen_subcommand_from help" -f -a "log" -d 'Open Log [ alias: L ]' +complete -c lcode -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from sync; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from submit; and not __fish_seen_subcommand_from sublist; and not __fish_seen_subcommand_from gencon; and not __fish_seen_subcommand_from tui; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from log; and not __fish_seen_subcommand_from star; and not __fish_seen_subcommand_from help" -f -a "star" -d 'Give the project a star' +complete -c lcode -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from sync; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from submit; and not __fish_seen_subcommand_from sublist; and not __fish_seen_subcommand_from gencon; and not __fish_seen_subcommand_from tui; and not __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from log; and not __fish_seen_subcommand_from star; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c lcode -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from code; and not __fish_seen_subcommand_from test" -f -a "code" -d 'Edit code(default)' +complete -c lcode -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from edit; and not __fish_seen_subcommand_from code; and not __fish_seen_subcommand_from test" -f -a "test" -d 'Edit test case' +complete -c lcode -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from edit" -f -a "detail" -d 'View detail' +complete -c lcode -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from fzy; and not __fish_seen_subcommand_from detail; and not __fish_seen_subcommand_from edit" -f -a "edit" -d 'Edit code'