Page 1 of 2

Console does not recognize -p option

Posted: Fri Jan 10, 2014 1:24 pm
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...

Re: Console does not recognize -p option

Posted: Fri Jan 10, 2014 3:56 pm
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.

Re: Console does not recognize -p option

Posted: Sat Jan 11, 2014 8:56 am
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...

Re: Console does not recognize -p option

Posted: Sat Jan 11, 2014 4:34 pm
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'"

Re: Console does not recognize -p option

Posted: Sat Jan 11, 2014 5:10 pm
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.

Re: Console does not recognize -p option

Posted: Sun Jan 12, 2014 7:41 pm
by Cas
You should be able to backslash escape the spaces, although been a while since tested console paths

Re: Console does not recognize -p option

Posted: Mon Jan 13, 2014 1:16 am
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...

Re: Console does not recognize -p option

Posted: Mon Jan 13, 2014 10:19 am
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

Re: Console does not recognize -p option

Posted: Mon Jan 13, 2014 11:02 am
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?..

Re: Console does not recognize -p option

Posted: Mon Jan 13, 2014 11:58 am
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.