Comments (6)
This is something I have considered. Indeed it's on the TODO list list (under 'low').
It would certainly be possible to do, for values at least. I don't think it would require any special option: the quotes alone should make the intent clear.
I'll see if I can squeeze it into the next release. For now you can use '-' or '_' to separate words, as a workaround:
$ tmsu tag spaced.doc full-name=totally-spaced
from tmsu.
Oh, cool!
Not sure the quotes will be enough, though. I just tried argv in Python and C (don't have Go installed now but I imagine it'll work the same). Passing comments="Best. Song. Ever."
means the program receives the string comments=Best. Song. Ever.
(no quotes). But there are other ways (e.g. if the value is invalid, treat it as full text).
I may send you a pull request at some point if you're open to it. In case you are, do you want to just extend values to accept whitespace and punctuation or have the fulltext ones treated separately?
from tmsu.
Yeah, it'll take some care but it should be fairly straightforward.
I'm happy for pull requests but please don't be offended if I don't apply them verbatim. I see this as simply handling whitespace rather than new 'fulltext' funcitonality so I wouldn't expect there to be any new option: simply that the following will then be possible:
$ tmsu tag somefile tag="value with spaces"
$ tmsu tag somefile tag='value with spaces'
$ tmsu tag somefile tag=value\ with\ spaces
When I've thought about this in the past it seemed relatively straightforward as the shell should do the parsing for you and put the whole string, spaces and all, into a single ARGV array element. I.e. 'tmsu tag somefile tag=value with spaces' should result in ['tag=', 'value', 'with', 'spaces'] whereas 'tmsu tag somefile tag='value with spaces' should be received as ['tag=value with spaces'].
The complications come from other aspects:
- 'tmsu files' supports queries and so TMSU currently joins the ARGV arguments together with spaces between before parsing the query language. This could potentially be handled by enquoting each element before joining with spaces and then upgrading the query parser to handle quotes.
- 'tmsu tag -' allows the user to tag from standard input or other file in which case there is no shell parsing support.
- The virtual filesystem exposes the tags/values as directories. I imagine this will work fine without changes but there could be unforeseen problems.
from tmsu.
It would also have to support spaces in the --tags option:
tmsu tag --tags="tag='value with spaces' othertag"
tmsu tag --tags='tag="value with spaces" othertag'
tmsu tag --tags="tag=value\ with\ spaces othertag"
from tmsu.
There is a tokenizer in tmsu/common/text for tokenising a string into fields with consideration for quotes.
from tmsu.
This is being implemented as part of issue #45.
from tmsu.
Related Issues (20)
- Pls consider making this tool available on conda HOT 1
- tmsu-fs-mv may overwrites files it cannot update internally HOT 4
- key-value tags will not work with rename HOT 5
- `tmsu tags --name=never` seems to imply `-1` HOT 1
- How can I delete values? HOT 4
- Need python example on how to import the tags for a file from a sqlite database into TMSU HOT 1
- Confusing status command behavior HOT 1
- ...
- Duplicated tags in file system HOT 1
- Repair files by automatically locating files based on checksum? HOT 2
- List all the tags with values HOT 11
- small contribution: sc-im interface for changing tmsu tags HOT 2
- Question: what does the error message mean? HOT 3
- --name=never removes lines HOT 2
- database locked occasionally
- VFS can be very slow
- Feature Request in VFS: Listing files outside of the `files` folder and hiding `queries` folder
- Cannot install TMSU HOT 1
- Package available in Void Linux
- too many SQL variables - transport endpoint is not connected when too many tag values exist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmsu.