Opened 4 years ago

Closed 2 years ago

#5743 closed Bug (fixed)

Unknown Option: -R

Reported by: silverhammermba Owned by: mike.dld
Priority: Normal Milestone: 2.91
Component: Daemon Version: 2.84+
Severity: Minor Keywords: backport-candidate-2.8x
Cc:

Description

The short option -R for --remove-and-delete does not work in the latest nightly.

$ transmission-remote -t11 -R
Unknown option: -R
$ transmission-remote -t11 --remove-and-delete
localhost:9091/transmission/rpc/ responded: "success"

The fix is to change the first NULL on line 281 of daemon/remote.c to "R".

Change History (11)

comment:1 Changed 4 years ago by cfpp2p

For what it is worth, I don't know if -R was ever meant to be enabled by default. I think the idea might have been that it would be too easy to mistakenly use -R instead of -r and with no warning at all your data would be deleted. By having to use --remove-and-delete it is quite a bit more obvious what you are doing.

Now ticket:5506 put the -R in the manpage, but -R actually wasn't enabled then, so I'm not sure why we got r14211.

The original code for transmission-remote's remove-and-delete stems from remote.c line 102 changeset 7664 and r7733 and it's not obvious to me the -R option always being disabled was a bug. It's been this way for a long time.

That's my opinion.

Last edited 4 years ago by cfpp2p (previous) (diff)

comment:2 Changed 4 years ago by silverhammermba

I don't have an opinion either way, but it's certainly confusing that man page mentions a non-existant option. The option should be added or the man page should not mention it.

comment:3 follow-up: Changed 4 years ago by jordan

  • Keywords backport-candidate-2.8x added
  • Milestone changed from None Set to 2.90
  • Owner set to jordan
  • Severity changed from Normal to Minor

Thanks for finding and reporting this!

After thinking about this a little, I agree that the long form is probably safer in that it might be easy to shoot yourself in the foot by typing -R instead of -r.

I've removed -R from the manpage in r14326.

comment:4 in reply to: ↑ 3 ; follow-up: Changed 4 years ago by x190

Replying to jordan:

After thinking about this a little, I agree that the long form is probably safer in that it might be easy to shoot yourself in the foot by typing -R instead of -r.

Nah! Then you should get rid of all short forms. Maybe change it to "-x"? :)

comment:5 Changed 3 years ago by mike.dld

  • Component changed from Transmission to Daemon

comment:6 Changed 2 years ago by mike.dld

  • Milestone changed from 2.90 to 2.91

comment:7 Changed 2 years ago by mike.dld

  • Owner changed from jordan to mike.dld
  • Status changed from new to assigned

comment:8 in reply to: ↑ 4 Changed 2 years ago by mike.dld

Replying to x190:

Replying to jordan:

After thinking about this a little, I agree that the long form is probably safer in that it might be easy to shoot yourself in the foot by typing -R instead of -r.

Nah! Then you should get rid of all short forms. Maybe change it to "-x"? :)

Unfortunately, -x is short for --pex already. What's left is h, j, k, q, and z, and then capitals A, B, E, F, H, I, J, K, L, Q, R, T, W, Z.

comment:9 Changed 2 years ago by mike.dld

I'm thinking "z" for "zap". Any other suggestions? :)

comment:10 Changed 2 years ago by x190

Multiple letters are legal, so it would be '8-)' to use '-rad' for 'remove and delete'.

comment:11 Changed 2 years ago by mike.dld

  • Resolution set to fixed
  • Status changed from assigned to closed

Sounds good. Transmission's options processor doesn't support concatenation of multiple short options, and it's highly unlikely to type '-rad' instead of '-r' :) And even if user isn't aware that concatenation isn't supported, '-rad' doesn't make sense as both '-a' and '-d' require an additional value argument.

Committed as r14707.

Note: See TracTickets for help on using tickets.