OFDL 1.10 does not process command line arguments #150

Open
opened 2026-02-27 07:17:27 +00:00 by wf · 1 comment

This powershell script ran fine through all versions of 1.9.x:

    param (
        [switch]$Menu
    )
    
    Push-Location X:\OFDLV1.7.80
    
    if ($Menu) {
        & 'X:\OFDLV1.7.80\OF DL.exe'
    }
    else{
        & 'X:\OFDLV1.7.80\OF DL.exe' "download"
    
    }
    Pop-Location 
}
Set-Alias OF Start-OFDL

After updating to 1.10, the script always dumps to the menu. --nonInteractive dumps to the menu. Googling the command line args refers to a -o "option=value" syntax which also doesn't work. (-o "NonInteractiveMode=true"). Other simple command line arguments like -? or --help also just runs to the menu.

This worked 10 hours ago. Even swapping the exe back to 1.9.20 works again.

🤷‍♂️

This powershell script ran fine through all versions of 1.9.x: ```function Start-OFDL { param ( [switch]$Menu ) Push-Location X:\OFDLV1.7.80 if ($Menu) { & 'X:\OFDLV1.7.80\OF DL.exe' } else{ & 'X:\OFDLV1.7.80\OF DL.exe' "download" } Pop-Location } Set-Alias OF Start-OFDL ``` After updating to 1.10, the script always dumps to the menu. --nonInteractive dumps to the menu. Googling the command line args refers to a ```-o "option=value" ``` syntax which also doesn't work. (-o "NonInteractiveMode=true"). Other simple command line arguments like -? or --help also just runs to the menu. This worked 10 hours ago. Even swapping the exe back to 1.9.20 works again. :man_shrugging:
Collaborator

Looking at the source code from 1.9.20, the reason that the "download" positional argument used to work was due to a bug in the logic that checked for the non-interactive flag (--non-interactive). The code in question would force the program to enter non-interactive mode if any CLI argument was passed to the program since the condition was always true.

After testing, the --non-interactive CLI argument works as expected in both CMD ("OF DL.exe" --non-interactive) and powershell (& '.\OF DL.exe' --non-interactive). Your issue is likely related to #149

Looking at the source code from 1.9.20, the reason that the "download" positional argument used to work was due to a bug in the logic that checked for the non-interactive flag (`--non-interactive`). The [code in question](https://git.ofdl.tools/sim0n00ps/OF-DL/src/tag/OFDLV1.9.20/OF%20DL/Program.cs#L493) would force the program to enter non-interactive mode if any CLI argument was passed to the program since the condition was always true. After testing, the `--non-interactive` CLI argument works as expected in both CMD (`"OF DL.exe" --non-interactive`) and powershell (`& '.\OF DL.exe' --non-interactive`). Your issue is likely related to https://git.ofdl.tools/sim0n00ps/OF-DL/issues/149
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sim0n00ps/OF-DL#150
No description provided.