On 10/11/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
> On 10/11/06, Philip Ganchev <[EMAIL PROTECTED]> wrote:
> > On 10/9/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
> > > On 10/9/06, Philip Ganchev <[EMAIL PROTECTED]> wrote:
> > > > On 10/8/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
> > [...]
> > > > How abot this.  Write a comment with a time stamp before each command,
> > > > that begins with a signature like "fish command executed at " or
> > > > something like that.  It would be easily parsable and documented.
> > > > Then perhaps the backslash escapes can be avoided.
> > > >
> > >
> > > If you did that, you'd have to somehow handle if the user writes out a
> > > comment with a timestamp inside a command. The only real solution I
> > [...]
> >
> > You can recognize such timestamp-comments and store them in modified
> > form, so that they are no longer recognized as timestamps.  For
> > example, prepend a #.  So the history would not contain exacly what
> > the user entered, but this true of all the other options, and this
> > version is much cleaner, I think.  We will rewrite history, in the
> > name of the people.
>
> We can either escape the '#' or the newline. Why is one better than the other?

1. Because one is consistent with Fish syntax, users can just execute
it without modifying it first.
2. It is easy to discover (again, because it is in Fish syntax).
Escapes are an extra element to learn about to understand the history.
3. Once they understand it, is still easier for people to parse, because:
3.1. Escapes are an extra element to take into account while reading
3.2. With escapes, the status of a line (Is it a separate command?)
is represented on the previous line.  This strikes me as more
conceptually complicated.

[...]
> > > A third possibility I've considered is to escape each command in the
> > > history, but that would severely reduce the greppability of the
> > > history file.
> >
> > Escape how?
>
> Regular backslash escapes. For example:
>
> echo 'first
> second…'
> #comment
>
> becomes
>
> echo \'first\nsecond\u2026\'\n\#comment
>
> Not very grep friendly, but easy enough to parse and understand.

Yeah.  And not human friendly.  Again, it's an extra level of
conceptual abstraction: a line is not what it looks like. And saved
code has to be modified before it can berun, because it is not valid
Fish syntax.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to