1 |
>>>>> On Mon, 23 Mar 2009, Ciaran McCreesh wrote: |
2 |
|
3 |
>> Now that "dosed" is going to be banned, what would people think of |
4 |
>> "newins" (and the other "new*" commands) accepting "-" as the first |
5 |
>> argument? |
6 |
|
7 |
> There's a slightly different variation in exheres-0: as well as do* |
8 |
> and new*, there's also here*, which you use like this: |
9 |
|
10 |
> hereins foo <<'END' |
11 |
> stuff |
12 |
> END |
13 |
|
14 |
Why would we need a new command for this? The minus sign denoting |
15 |
standard input is fairly common with other utilities. |
16 |
|
17 |
> It magically barfs, rather than hanging indefinitely, if you forget |
18 |
> to give it some input. |
19 |
|
20 |
I guess the same could be done for "newins -", if you think that it is |
21 |
necessary (test for stdin being a terminal?). But I don't really see |
22 |
the point of it, since such a mistake would be noticed immediately |
23 |
when testing the ebuild. |
24 |
|
25 |
> The rationale for giving it a new name rather than overloading an |
26 |
> existing one is that some of the existing do* utilities don't take |
27 |
> just a single simple filename, so overloading would make the command |
28 |
> line somewhat convoluted. |
29 |
|
30 |
It doesn't make much sense to specify "-" as an argument for "do*", |
31 |
because the command would not know under which name the file should be |
32 |
installed. OTOH, all "new*" commands have exactly two arguments, so we |
33 |
could allow "-" for the first argument. |
34 |
|
35 |
Ulrich |