Bug #137
Allow escaped commas in command line
| Status: | New | Start: | 02/04/2010 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | % Done: | 0% |
||
| Category: | Core | |||
| Target version: | 0.9.3 | |||
Description
It sometimes comes up that a comma will be needed as part of an argument passed on the command line. In such a case an escaped comma option would be nice. There is a solution at http://paste.pocoo.org/show/174044/ if you want that.
Related issues
| related to Feature #69 | Investigate translation of CLI per-task args to Python types | Assigned | 10/20/2009 |
History
Updated by Erich Heine 175 days ago
Actually line 13 of the paste should be:
unfinished += sep + endlist[0]
Updated by Jeff Forcier 175 days ago
- Target version set to 1.0
Sorry to be so interrogative :) Is there a reason commas are necessary in the values given? I.e. is there a reason you cannot have your task split on something other than a comma, like a semicolon? That’s generally what I do.
This might be related to #69 as well, which explores the idea of expanding CLI per-task args to make it easier to map to standard Python types. If your comma separation is mostly a way of getting a list of strings, then having a concrete list input syntax would do away with the need for escaping commas.
Updated by Erich Heine 174 days ago
This actually came up twice for me. Once in a task which does some mucking around with files kept in subversion. The final step of this task is to do a checkin. One of my parmeters from the commandline is commit_message, which is just a string. The other is very similar, also a log message (command line option notes), but just appended to a file w/ the time. Both involve input that is not for the computer, but intended for human reading later, and as such are certain to include commas at some point.
The other argument I present is that it is just the right thing to do. There are some command line tools that take comma separated command line arguments, and should someone ever want to just pass those through, they will have to do extra work in frabric to make that happen. (And will find it annoying that they have to replace comma with semicolon, only to hae fabric turn them back — particularly if they are proficient with the wrapped tool). Providing escapes to magic characters is a pretty time tested design rule.
Updated by Jeff Forcier 174 days ago
Good points; I'm convinced. Thanks for taking the time to elaborate.
Updated by Erich Heine 173 days ago
Put this code, plus updated docs in my fork at: http://github.com/sophacles/fabric/tree/bug137
Updated by Erich Heine 55 days ago
Id like to suggest putting this in 0.9.2 — it is completely backwards compatible, and doesn’t introduce new concepts.
Updated by Jeff Forcier 55 days ago
- Target version changed from 1.0 to 0.9.3
Let’s compromise and say 0.9.3, 0.9.2 is already pretty heavily loaded. (I will be trying to do releases much more often, though — it definitely won’t be another 6 months from now!)
Also available in: Atom