Am 29.04.2014 12:24, schrieb Urs Liska:
Hi all,
I'm writing a set of functions to retrieve Git repository information
for use in a score:
https://github.com/openlilylib/snippets/tree/master/editorial-tools/git-commands
I'm using a function provided by Lars Haulin in a comment to a blog post
that is essentially the one for open-input-pipe given here:
https://www.gnu.org/software/guile/manual/html_node/Pipes.html
In addition to what is already there I want to write commands that use
more than one line of the Git commands' output (e.g. print the whole
commit message).
How would I approach that in Scheme?
What I need is for example a list of all strings that the command outputs.
Do I have to write some kind of loop while the pipe is open?
Or is there a way to get the whole output as one string or a list of
strings?
Well, RTFM at least gives a start:
Using read-delimited instead of read-line returns the complete output in
one string.
And using (string-split git-function-name #\newline)
provides me with a list of strings.
Next step to find out will be to process this list of strings to a
usable markup function ...
Urs
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user