From 79ddac4953a7dde072dd63c7c5df5d510612f882 Mon Sep 17 00:00:00 2001
From: Christophe Garion <tofgarion@runbox.com>
Date: Mon, 16 Jan 2017 13:21:12 +0100
Subject: [PATCH] listings: use colors as option

---
 my-listings.sty | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/my-listings.sty b/my-listings.sty
index 4ff2410..5a26026 100644
--- a/my-listings.sty
+++ b/my-listings.sty
@@ -1,10 +1,18 @@
 %% personal config for listings
-%% C. Garion, 2012-2015
+%% C. Garion, 2012-2017
 %%
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesPackage{my-listings}[2015/11/16 v0.1
+\ProvidesPackage{my-listings}[2017/01/16 v0.2
                  LaTeX package for listings configuration]
 
+% options
+\def\@colorlst{}
+\DeclareOption{colors}{
+  \def\@colorlst{true}
+}
+
+\ProcessOptions\relax
+
 % LuaLaTeX
 \RequirePackage{ifluatex}
 
@@ -179,4 +187,12 @@
         commentstyle=\color{lstgreen},
         identifierstyle=\color{lstblue}
 }
-}
\ No newline at end of file
+}
+
+\ifx@colorlst\@empty
+\relax
+\else
+\lstusecolors
+\fi
+
+\endinput
\ No newline at end of file
-- 
GitLab