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

use & to load completions for PowerShell #1978

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

Conversation

hycinth22
Copy link

@hycinth22 hycinth22 commented May 14, 2024

in src/building/suggested.md

You can use source ./src/etc/completions/x.py.<extension>
to load completions for your shell of choice,
or source .\src\etc\completions\x.py.ps1 for PowerShell.

to my best knowledge, there is no source command in powershell. it is available only in unix-like os.
we should use call operator(&) to load .ps1 script file for powershell

@hycinth22
Copy link
Author

hycinth22 commented May 14, 2024

Other choice we may have:

  1. Execute the filename directly: .\src\etc\completions\x.py.ps1
    This is equivalent to call operator, but its semantics are not clear enough

  2. Invoke-Expression: Invoke-Expression -Command ".\src\etc\completions\x.py.ps1"
    too long and no obvious benefit

  3. Dot-Sourcing: . .\src\etc\completions\x.py.ps1
    all definitions in the script will be import to the current session. we dont need so much

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.

None yet

1 participant