Opened 12 years ago

Closed 11 years ago

#2983 closed Enhancement (fixed)

command-line utility for creating .torrent files

Reported by: charles Owned by: charles
Priority: Normal Milestone: 2.10
Component: Transmission Version: 1.91
Severity: Normal Keywords:
Cc:

Description

transmission-cli has been deprecated for a long time now because most of what it does is done better in other applications. However it has one feature not otherwise available from the command line: creating .torrent files.

We should add a new command-line utility specifically for this, so the functionality is not lost when we finally remove transmission-cli from the build.

Attachments (4)

utils.diff (22.3 KB) - added by charles 12 years ago.
first draft of command-line utils
utils.r2.diff (27.2 KB) - added by charles 11 years ago.
add scraping support to transmission-show
utils.r3.diff (28.3 KB) - added by charles 11 years ago.
Fix infinite loop when removing URL. Better cleanup of empty tiers and empty announce-lists.
utils.r4.diff (41.6 KB) - added by charles 11 years ago.
removed from transmission-cli: torrent creation, info dumps, and scraping

Download all attachments as: .zip

Change History (23)

comment:1 Changed 12 years ago by Eszet

Since this ticket is the only one still unassigned for version 2.0, I would volunteer for the implementation.

comment:2 Changed 12 years ago by charles

great!

comment:3 Changed 12 years ago by charles

Eszet: any news?

comment:4 follow-up: Changed 12 years ago by Eszet

Yes, I'm working on a patch. Juliusz is quite demanding wrt the LDS patch we are trying to get ready - I gave that priority, so my work on the cli frontend suffered somewhat.

Before I post a patch missing essential features, are there any special requirements for the .torrent tool (not present in the current code) I should consider right now?

Last edited 12 years ago by Eszet (previous) (diff)

comment:5 in reply to: ↑ 4 Changed 12 years ago by charles

Replying to Eszet:

Yes, I'm working on a patch. Juliusz is quite demanding wrt the LDS patch we are trying to get ready - I gave that priority, so my work on the cli frontend suffered somewhat.

Ha! That sounds very Juliusz :)

I agree with you that LDS should get the higher priority. That would be very nice to put into 2.00.

Before I post a patch missing essential features, are there any special requirements for the .torrent tool (not present in the current code) I should consider right now?

None that I can think of. Maybe after the first draft forgotten features will show up... :) Partially this is to further deprecate transmission-cli, and partially to replace the clumsy command-line syntax of creating torrents with transmission-cli.

comment:6 Changed 12 years ago by Eszet

Speaking of a clumsy command line syntax. Your mentioning triggered a few ideas on my part, how we could introduce a new and more intuitive syntax for creating a torrent (accessible especially for non-power users).

I have some working prototype code using the following syntax:

$cmd <file> [<switches>] [--] [<meta-info>]

where <switches>, --, and <meta-info> are optional. To avoid ambiguities, it is possible to separate the meta part from the rest of the command line explicitly via --.

In the most simple case, this would translate to:

$cmd some_file

which will create some_file.torrent.

In a more complex example:

$cmd some_file -o new.torrent -- private announcers=url1,url2 comment="some stuff"

Charles, please let me know if this is a viable path to pursue, so I can continue to build on my prototype code. If you think of it as counter-intuitive, I will come up with something more conservative.

Last edited 12 years ago by Eszet (previous) (diff)

comment:7 Changed 12 years ago by charles

I'm not sure what advantage this has over the more traditional

$cmd some_file -o new.torrent --private --announcers=url1,url2 --comment="some stuff"

comment:8 Changed 12 years ago by Eszet

Well, the idea is to come closer to natural language for a majority of scenarios where you have to fire up the tool.

Here, you won't have to learn any particular syntax, just type as you go:

$cmd some_file private comment="some stuff"

Of course, as this deviates from the standard CLI syntax, you have to get acquainted to that first (e.g., by having a look into the man page). But how does that differ from any other command line tool you haven't used before? It's not that much, but I see the advantage that users don't have to memorize abbreviations while saving most of the syntactic noise.

Charles, I am certainly not insisting on getting this through, it's just a proposal.

comment:9 Changed 12 years ago by charles

Charles, I am certainly not insisting on getting this through, it's just a proposal.

Oh, I understand. I'm not trying to be prickly about this :)

I see the advantage that users don't have to memorize abbreviations while saving most of the syntactic noise.

For people who don't want to learn the abbreviations (and I'm usually one of them) there is always the long form of the arguments. In the examples you gave, it really would just be adding a "--" before the "private" keyword.

I see your point that making the "--" implicit does feel more human, but I think that's outweighed by the need to be consistent with other command-line applications, which universally use the " -p --private " style notation.

comment:10 Changed 12 years ago by charles

  • Milestone changed from 2.00 to Sometime

comment:11 Changed 12 years ago by charles

  • Milestone changed from Sometime to 2.10

Changed 12 years ago by charles

first draft of command-line utils

comment:12 follow-up: Changed 11 years ago by Eszet

Mhm, that's different from what I was up to. Do you think three separate commands are easier to handle for the command line user?

Sorry for my lack of input lately. My local version of 'transmission-cli' is (obviously) pretty much identical to your 'transmission-create'. However, what about scrape? You don't think it might be needed on the CLI?

comment:13 in reply to: ↑ 12 Changed 11 years ago by charles

Replying to Eszet:

Mhm, that's different from what I was up to. Do you think three separate commands are easier to handle for the command line user?

The main rationale for that was to reduce the number of overlapping command-line arguments -- all the transmission-create arguments are for torrent creation, etc. The command-line arguments to the trunk version of transmission-cli are kind of a mess.

Sorry for my lack of input lately.

No worries. It comes with the territory in volunteer projects.

Actually with your strong networking skills, you might look over #2313 and see if it's interesting to you. I don't think I'm the best person to review the patch there, either on (a) its own merits or (b) wrt portability.

If #2313 isn't interesting, feel free to look at other tickets, or to file a new one :)

However, what about scrape? You don't think it might be needed on the CLI?

Definitely. That's still missing from my patch but it makes most sense as a new arg to transmission-show.

Changed 11 years ago by charles

add scraping support to transmission-show

comment:14 Changed 11 years ago by Eszet

I tried the R1 patch and my feedback for you is good so far. Except for removing an announce URL ended up in an infinite loop. I know too little about the functions' behavior you're using in the nested while loop. If you don't see an obvious error, I will drill further into the problem to isolate it (and give you a more specific description).

Apart from that, I think the splitting of the CLI tools works well (in contradiction to my first design ;).

Changed 11 years ago by charles

Fix infinite loop when removing URL. Better cleanup of empty tiers and empty announce-lists.

comment:15 Changed 11 years ago by charles

Eszet: I fixed the infinite loop and cleaned things up a little more. Thanks!

Changed 11 years ago by charles

removed from transmission-cli: torrent creation, info dumps, and scraping

comment:16 Changed 11 years ago by charles

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

Added to trunk for 2.10 by r10783

comment:17 Changed 11 years ago by charles

  • Resolution fixed deleted
  • Status changed from closed to reopened

reopened for attribution

comment:18 Changed 11 years ago by charles

  • Owner set to charles
  • Status changed from reopened to new

comment:19 Changed 11 years ago by charles

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.