TMSU icon indicating copy to clipboard operation
TMSU copied to clipboard

Move tag/value creation functionality into new subcommand

Open oniony opened this issue 9 years ago • 0 comments

Currently you can create tags (without tagging any files) using the tag subcommand:

$ tmsu tag --create sometag

This effectively says "create a tag called 'sometag'". Contrast this to the more common usage of tag, where files are tagged:

$ tmsu tag somefile sometag

This effectively says "tag a file called 'somefile' with tag 'sometag'". As you can see, in the tag creation case the word 'tag' is used as a noun and in the normal case it's used as a verb. The --create option subverts the meaning of the command, which is mildly jarring. However it goes from jarring to confusing when creating values:

$ tmsu tag --create =somevalue

Here we are saying "create a value called 'somevalue'", but to do so we have to issue the 'tag' subcommand and then use the '=' to hint that it's actually a value we want.

Proposal:

  1. Remove the --create option from the tag subcommand so that the only operation the tag subcommand does is in the verb sense: it tags files.
  2. Add a new subcommand called create, whose sole purpose in life is to create stuff. This would create tags by default or values if you give it the --value option...just like the other subcommands.

The two operations above would then become:

$ tmsu create sometag
$ tmsu create --value somevalue

oniony avatar Apr 23 '16 21:04 oniony