Closed eevan78 closed 7 months ago
Hi, @eevan78, thanks for having made an issue.
Hi @ebb-earl-co , I'm using the latest version of EXE, Release 2024.2.1. Here is the output of the commands:
PS D:\Software\Tidal-dl> .\tidal-wave_py311_pyapp.exe --show-completion pwsh
Import-Module PSReadLine
Set-PSReadLineKeyHandler -Chord Tab -Function MenuComplete
$scriptblock = {
param($wordToComplete, $commandAst, $cursorPosition)
$Env:_PYTHON _M TIDAL_WAVE_COMPLETE = "complete_powershell"
$Env:_TYPER_COMPLETE_ARGS = $commandAst.ToString()
$Env:_TYPER_COMPLETE_WORD_TO_COMPLETE = $wordToComplete
python -m tidal_wave | ForEach-Object {
$commandArray = $_ -Split ":::"
$command = $commandArray[0]
$helpString = $commandArray[1]
[System.Management.Automation.CompletionResult]::new(
$command, $command, 'ParameterValue', $helpString)
}
$Env:_PYTHON _M TIDAL_WAVE_COMPLETE = ""
$Env:_TYPER_COMPLETE_ARGS = ""
$Env:_TYPER_COMPLETE_WORD_TO_COMPLETE = ""
}
Register-ArgumentCompleter -Native -CommandName python -m tidal_wave -ScriptBlock $scriptblock
PS D:\Software\Tidal-dl> .\tidal-wave_py311_pyapp.exe --install-completion pwsh
Shells.pwsh completion installed in C:\Users\xxxxx\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
Completion will take effect once you restart the terminal
PS D:\Software\Tidal-dl>
Upon restarting the shell, I get the following:
PowerShell 7.4.1
ParserError: C:\Users\xxxxx\Documents\PowerShell\Microsoft.PowerShell_profile.ps1:5
Line |
5 | $Env:_PYTHON _M TIDAL_WAVE_COMPLETE = "complete_powershell"
| ~~
| Unexpected token '_M' in expression or statement.
PS C:\Windows\System32>
$Env:_PYTHON _M TIDAL_WAVE_COMPLETE
is the environment variable I was refering to in issue description, and there are two more, shown in the output of the first command.
Thanks for your assistance!
@eevan78 I don't know if --show-completion
is a typical Powershell feature, or if it's expected from tidal-wave
itself: what I do know is that I had not seen this before you raised this issue!
I know that the Python library I use to handle the CLI arguments and running the main logic, typer
has something to say about CLI option autocompletion in its documentation, but I have not looked into it, nor have I considered it as part of tidal-wave
's core features.
If you can respond with a bit more information about this --show-completion
flag, then maybe we can figure out what's going on here, but I can't promise any more assistance as this is outside what I know how to support in terms of tidal-wave
's use on Windows.
P.S. does the executable work to retrieve audio and/or video as you would like? That, to me, is the most important question.
@ebb-earl-co I didn't know that this is a part of the library... Thanks for help, I will figure out how to make it work if it's possible. Executable works as a charm, no problems at all. So please don't waste your time on this, I'll close the issue!
Hi, i tried to setup the completion in PowerShell 7.4.1, but I didn't manage to make it work. I'm using the
tidal-wave_py311_pyapp.exe
, I don't have Python installed on my system. As it is, the code cannot work, of course, as the command called in scriptblock to extract the information ispython -m tidal-wave
. I suppose that the environment variables there are just for debugging purpose. But there is a typo in one of them, as it has two spaces in it's name:$Env:_PYTHON _M TIDAL_WAVE_COMPLETE
. Is it possible to have this working withtidal-wave_py311_pyapp.exe
, or it has to be used only on systems with installed Python?