Commit 0c599ca0 authored by Jose A. Lopes's avatar Jose A. Lopes
Browse files

Add flag '--opcodes' to 'hs2py'



This is a transitional step before merging 'hs2py-constants' and
'hs2py'.
Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent ff37391a
......@@ -1871,7 +1871,7 @@ lib/opcodes.py: Makefile src/hs2py src/Ganeti/Constants.hs \
lib/opcodes.py.in_before lib/opcodes.py.in_after \
| stamp-directories
cat $(abs_top_srcdir)/lib/opcodes.py.in_before > $@
src/hs2py >> $@
src/hs2py --opcodes >> $@
cat $(abs_top_srcdir)/lib/opcodes.py.in_after >> $@
lib/_generated_rpc.py: lib/rpc_defs.py $(BUILD_RPC)
......
......@@ -25,5 +25,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
import Ganeti.Hs2Py.GenOpCodes
import System.Environment (getArgs)
import System.Exit (exitFailure)
import System.IO (hPutStrLn, stderr)
main :: IO ()
main = putStrLn showPyClasses
main = do
args <- getArgs
case args of
["--opcodes"] -> putStrLn showPyClasses
_ -> do
hPutStrLn stderr "Usage: hs2py --opcodes"
exitFailure
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment