Skip to content

Commit

Permalink
Add --svg option (close #50)
Browse files Browse the repository at this point in the history
  • Loading branch information
noteflakes committed Jan 16, 2017
1 parent 2f68ddb commit 5f0fa1b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ releases
dist
*.pdf
*.ps
*.png
*.png
*.svg
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- Add `--svg` command line option (#50).
- Improve Lilypond commandline option parsing.
- Remove non-functional `--open` switch.
- Improve error reporting (print backtrace only when `--verbose` is specified).
- Add `--music`/`--music-relative` command line switch for quickly entering music on the command line (#47).
Expand Down
2 changes: 2 additions & 0 deletions lib/lyp/lilypond.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def parse_lilypond_arg(arg, argv, argv_clean, options)
options[:mode] = :system
when '--invoke-quiet'
options[:mode] = :quiet
when '--svg'
argv_clean.concat ['-dbackend=svg']
else
argv_clean << arg
end
Expand Down
7 changes: 7 additions & 0 deletions spec/lilypond_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -527,4 +527,11 @@
expect(o).to eq({verbose: true})
expect(a).to eq(["--verbose", "myfile.ly"])
end

it "supports --svg" do
argv = ["--svg", "myfile.ly"]
o, a = Lyp::Lilypond.preprocess_argv(argv)
expect(o).to eq({})
expect(a).to eq(["-dbackend=svg", "myfile.ly"])
end
end

0 comments on commit 5f0fa1b

Please sign in to comment.