lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a simple way to test for command line options?


From: Jean Abou Samra
Subject: Re: Is there a simple way to test for command line options?
Date: Tue, 10 Jan 2023 19:27:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

Le 10/01/2023 à 19:11, Timothy Lanfear a écrit :
The function ly:command-line-options returns a string with all the -d options. The backend option is set to svg when when generating svg output and absent by default.

\version "2.22.0"

#(let* ((options (ly:command-line-options))
        (svg     (string-contains options "(backend . svg)")))
  (if (integer? svg) (ly:message "svg") (ly:message "not svg")))

{
  c''1
}




In recent versions, this is not always true: if you compile with the Cairo
backend, using -dbackend=cairo, the 'backend option is set to 'cairo
regardless of the output format. In fact, in the Cairo backend, you
can generate PDF and SVG in the same LilyPond invocation. Therefore,
I think it's best to use either environment variables, or the
-e / --evaluate option described here:

https://lilypond.org/doc/v2.24/Documentation/usage/command_002dline-usage#basic-command-line-options-for-lilypond

Best,
Jean

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]