Commit eed5444d by Zachary Snow

updated version info with git hash

parent 3c08767b
...@@ -2,7 +2,7 @@ BSD 3-Clause License ...@@ -2,7 +2,7 @@ BSD 3-Clause License
Copyright for portions of sv2v are held by Tom Hawkins, 2011-2015, as part of Copyright for portions of sv2v are held by Tom Hawkins, 2011-2015, as part of
tomahawkins/verilog. Copyright for all other portions of sv2v are held by tomahawkins/verilog. Copyright for all other portions of sv2v are held by
Zachary Snow, 2019. Zachary Snow, 2019-2020.
All rights reserved. All rights reserved.
......
...@@ -744,6 +744,39 @@ Dependency: ghc-prim-0.5.3 ...@@ -744,6 +744,39 @@ Dependency: ghc-prim-0.5.3
================================================================================ ================================================================================
Dependency: githash-0.1.3.1
================================================================================
Copyright (c) 2018, Michael Snoyman, 2015, Adam C. Foltzer
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of gitrev nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================================================
Dependency: happy-1.19.9 Dependency: happy-1.19.9
================================================================================ ================================================================================
......
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TemplateHaskell #-}
{- sv2v {- sv2v
- Author: Zachary Snow <zach@zachjs.com> - Author: Zachary Snow <zach@zachjs.com>
- -
...@@ -7,6 +8,7 @@ ...@@ -7,6 +8,7 @@
module Job where module Job where
import GitHash (giHash, tGitInfoCwd)
import System.IO (stderr, hPutStr) import System.IO (stderr, hPutStr)
import System.Console.CmdArgs import System.Console.CmdArgs
import System.Environment (getArgs, withArgs) import System.Environment (getArgs, withArgs)
...@@ -27,6 +29,11 @@ data Job = Job ...@@ -27,6 +29,11 @@ data Job = Job
, verbose :: Bool , verbose :: Bool
} deriving (Show, Typeable, Data) } deriving (Show, Typeable, Data)
gitHash :: String
gitHash = giHash $$tGitInfoCwd
shortGitHash :: String
shortGitHash = take 7 gitHash
defaultJob :: Job defaultJob :: Job
defaultJob = Job defaultJob = Job
{ files = def &= args &= typ "FILES" { files = def &= args &= typ "FILES"
...@@ -43,9 +50,10 @@ defaultJob = Job ...@@ -43,9 +50,10 @@ defaultJob = Job
, verbose = nam "verbose" &= help "Retain certain conversion artifacts" , verbose = nam "verbose" &= help "Retain certain conversion artifacts"
} }
&= program "sv2v" &= program "sv2v"
&= summary "sv2v v0.0.1, (C) 2019 Zachary Snow, 2011-2015 Tom Hawkins" &= summary ("sv2v v0.0.1 (" ++ shortGitHash ++ ")")
&= details [ "sv2v converts SystemVerilog to Verilog." &= details [ "sv2v converts SystemVerilog to Verilog."
, "More info: https://github.com/zachjs/sv2v" ] , "More info: https://github.com/zachjs/sv2v"
, "(C) 2019-2020 Zachary Snow, 2011-2015 Tom Hawkins" ]
&= helpArg [explicit, name "help", groupname "Other"] &= helpArg [explicit, name "help", groupname "Other"]
&= versionArg [explicit, name "version"] &= versionArg [explicit, name "version"]
&= verbosityArgs [ignore] [ignore] &= verbosityArgs [ignore] [ignore]
......
...@@ -30,6 +30,7 @@ executable sv2v ...@@ -30,6 +30,7 @@ executable sv2v
containers, containers,
directory, directory,
filepath, filepath,
githash,
hashable, hashable,
mtl, mtl,
Unique Unique
......
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