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

Feature dynamic autocomplete for target orgs #614

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5b5325d
feat: get all authorized orgs from command 'sf org auth', and display…
gilgourevitch Jan 25, 2024
7e179fa
feat: works for bash
gilgourevitch Jan 26, 2024
b453c89
feat: refine zsh version for colon-separated commands
gilgourevitch Jan 29, 2024
3fb293a
feat: remove unecessary code from index
gilgourevitch Jan 29, 2024
cd7d261
feat: powershell version
gilgourevitch Jan 31, 2024
52d727e
feat: sort org list for all shells
gilgourevitch Jan 31, 2024
82dd62e
feat: remove warnings from cli when retrieving orgs
gilgourevitch Jan 31, 2024
5c4159e
test: tests #bashCompletionFunction and #bashCompletionFunction with …
gilgourevitch Feb 1, 2024
5769b1d
test: bash generates a valid completion file
gilgourevitch Feb 1, 2024
a846c01
test: bash generates a valid completion file with an alias
gilgourevitch Feb 1, 2024
eb9c41d
test: bash generates a valid completion file with multiple aliases
gilgourevitch Feb 1, 2024
b9d0fb8
test: #zshCompletionFunction
gilgourevitch Feb 1, 2024
c6ed843
test: zsh generates a valid completion file
gilgourevitch Feb 1, 2024
42f4699
test: generates a valid completion file with a bin alias
gilgourevitch Feb 1, 2024
5615e3c
test: generates a valid completion file with multiple bin aliases
gilgourevitch Feb 1, 2024
418e3a7
test: powershell generates a valid completion file
gilgourevitch Feb 1, 2024
93bb0a9
test: powershell generates a valid completion file with a bin alias
gilgourevitch Feb 1, 2024
d73229a
test: powershell generates a valid completion file with multiple bin …
gilgourevitch Feb 1, 2024
38ffe82
fix: use $null instead of null to mask warnings
gilgourevitch Feb 1, 2024
c2c6c41
feat: use a new flag to display up-to-date dynamic org list, but have…
gilgourevitch Feb 2, 2024
0f88fe0
test: bash tests fixed
gilgourevitch Feb 5, 2024
76b67b7
test: powershell tests fixed
gilgourevitch Feb 5, 2024
bef1088
test: zsh tests fixed
gilgourevitch Feb 5, 2024
b2fd8b0
test: fix indentation for installations instructions
gilgourevitch Feb 5, 2024
f9d7e2e
test: private methods tests fixed
gilgourevitch Feb 5, 2024
727cf8a
Merge branch 'main' into feature--dynamic-autocomplete-for-target-org
gilgourevitch Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: generates a valid completion file with a bin alias
  • Loading branch information
gilgourevitch committed Feb 1, 2024
commit 42f4699ff98137fedbecfc525218d3a1baf82902
2 changes: 1 addition & 1 deletion src/autocomplete/zsh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ _orgs(){
orgs=(
${this.genOrgs()}
)

_describe -t orgs 'orgs' orgs && return 0
}

Expand Down
15 changes: 13 additions & 2 deletions test/autocomplete/zsh.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ _orgs(){
org2.username@org.com
org3alias
)

_describe -t orgs 'orgs' orgs && return 0
}

Expand Down Expand Up @@ -353,10 +353,21 @@ _test-cli
it('generates a valid completion file with a bin alias.', () => {
config.bin = 'test-cli'
config.binAliases = ['testing']
const zshCompWithSpaces = new ZshCompWithSpaces(config as Config)
const zshCompWithSpaces = new ZshCompWithSpaces(config as Config, testOrgs)
expect(zshCompWithSpaces.generate()).to.equal(`#compdef test-cli
compdef testing=test-cli

_orgs(){
local orgs
orgs=(
org1alias
org2.username@org.com
org3alias
)

_describe -t orgs 'orgs' orgs && return 0
}

_test-cli_app() {
local context state state_descr line
typeset -A opt_args
Expand Down