Console does not recognize -p option

Specific support for Deluge on Microsoft Windows OS
Simbiat
Member
Member
Posts: 46
Joined: Fri Jan 10, 2014 1:19 pm

Console does not recognize -p option

Post by Simbiat »

Hi!

I am having an issue with deluge console in 1.3.6 build: it does not recognize -p\--PATH= options for "add" command. Whenever I try to use it, it says exactly this thing:
deluge-console.exe: error: no such option: -p

This makes it impossible to add torrent, while saving it to a specific location.

I also noticed, that if my to .torrent file has spaces and I added it to console command in quotes (as usually is expected on Windows) it splits the string by those spaces, thus trying to add several non-existing torrent files...

Seems like this is the issue on all available windows builds...
laharah
Member
Member
Posts: 26
Joined: Wed Jan 08, 2014 2:41 am

Re: Console does not recognize -p option

Post by laharah »

I'm not in front of my PC at the moment, so I can't test it, but if I remember correctly, the deluge-console.exe in wondows has to have all it's arguments in quotes. Like this:

Code: Select all

deluge-console.exe "add -p C:\Download\Location C:\path\to\torrent.torrent"
that should work so long as your deluge isn't in classic mode

as for the spaces, I'm not sure, I know that the windows escape character is '^' so you could try this:

Code: Select all

deluge-console.exe "add -p C:\Download\Location C:\path\to\torrent^ with^ spaces.torrent"
give that a whirl and see if it works.
Simbiat
Member
Member
Posts: 46
Joined: Fri Jan 10, 2014 1:19 pm

Re: Console does not recognize -p option

Post by Simbiat »

Code: Select all

deluge-console.exe "add -p C:\Download\Location C:\path\to\torrent.torrent"
works. As for spaces, it seems like putting them in in single quotes like this works:

Code: Select all

deluge-console.exe "add -p C:\Download\Location C:\path\to\torrent' 'with' 'spaces.torrent"
but in this case there is a problem with using the single quote sign in the path...
laharah
Member
Member
Posts: 26
Joined: Wed Jan 08, 2014 2:41 am

Re: Console does not recognize -p option

Post by laharah »

Can you surround the entire path name in single quotes? like this:

Code: Select all

deluge-console.exe "add -p C:\Download\Location 'C:\path\to\torrent with spaces.torrent'"
Simbiat
Member
Member
Posts: 46
Joined: Fri Jan 10, 2014 1:19 pm

Re: Console does not recognize -p option

Post by Simbiat »

laharah wrote:Can you surround the entire path name in single quotes? like this:

Code: Select all

deluge-console.exe "add -p C:\Download\Location 'C:\path\to\torrent with spaces.torrent'"
yes, you can. it will also work. BUT, if the path has a single quote - it will fail, demanding a closing one.
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Console does not recognize -p option

Post by Cas »

You should be able to backslash escape the spaces, although been a while since tested console paths
Simbiat
Member
Member
Posts: 46
Joined: Fri Jan 10, 2014 1:19 pm

Re: Console does not recognize -p option

Post by Simbiat »

Cas wrote:You should be able to backslash escape the spaces, although been a while since tested console paths
backslashes do not work. adn they should not, since they are converted to normal slashes, as far as I remember...
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Console does not recognize -p option

Post by Cas »

Ah yes sorry forgot about the windows shell interpreting the backslash. In that case you can use backslashed doublequotes around the path:

Code: Select all

deluge-console.exe "add -p C:\Download\Location \"C:\path\to\torrent with spaces and quot'd.torrent\""
with the console if in doubt keep adding quotes until it works :P
Simbiat
Member
Member
Posts: 46
Joined: Fri Jan 10, 2014 1:19 pm

Re: Console does not recognize -p option

Post by Simbiat »

Cas wrote:Ah yes sorry forgot about the windows shell interpreting the backslash. In that case you can use backslashed doublequotes around the path:

Code: Select all

deluge-console.exe "add -p C:\Download\Location \"C:\path\to\torrent with spaces and quot'd.torrent\""
with the console if in doubt keep adding quotes until it works :P
maybe you can then simply remove the original quotes from the interpretor?.. Because, commonly only paths and similar constructions are quoted in Windows CMD language... And then interpret what's inside "" as one single path... Or is it some kind of Python limitation?..
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Console does not recognize -p option

Post by Cas »

It's complicated as the args are processed a few times before console gets them and spaces usually denote separate args. It might be possible but it works well, with a few quirks, so wouldn't want to change it.
Post Reply