Skip to content

Commit

Permalink
Merge pull request #314 from haskell/wip/T301
Browse files Browse the repository at this point in the history
Implement --numeric-version (#301)
  • Loading branch information
Ericson2314 authored Sep 26, 2024
2 parents 4b59fb3 + 77e6321 commit 6cb1b7d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revision history for Happy

## 2.1

* Added `--numeric-version` CLI flag.

## 2.0.2

The 2.0.1 release in turn exposed two more regressions:
Expand Down
11 changes: 9 additions & 2 deletions app/Main.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Read and parse the CLI arguments.
> case getOpt Permute argInfo (constArgs ++ args) of
> (cli,_,[]) | DumpVersion `elem` cli ->
> bye copyright
> (cli,_,[]) | DumpNumericVersion `elem` cli ->
> bye projectVersion
> (cli,_,[]) | DumpHelp `elem` cli -> do
> prog <- getProgramName
> bye (usageInfo (usageHeader prog) argInfo)
Expand Down Expand Up @@ -307,6 +309,7 @@ The command line arguments.
> | DumpGoto
> | DumpLA
> | DumpVersion
> | DumpNumericVersion
> | DumpHelp
> | OptInfoFile (Maybe String)
> | OptPrettyFile (Maybe String)
Expand Down Expand Up @@ -355,11 +358,12 @@ The command line arguments.
> Option ['?'] ["help"] (NoArg DumpHelp)
> "display this help and exit",
> Option ['V','v'] ["version"] (NoArg DumpVersion) -- ToDo: -v is deprecated
> "output version information and exit"
> "output version information and exit",
> Option [] ["numeric-version"] (NoArg DumpNumericVersion) -- ToDo: -v is deprecated
> "output the version number and exit",

Various debugging/dumping options...

> ,
> Option [] ["ddump-mangle"] (NoArg DumpMangle)
> "Dump mangled input",
> Option [] ["ddump-lr0"] (NoArg DumpLR0)
Expand Down Expand Up @@ -424,6 +428,9 @@ Extract various command-line options.

------------------------------------------------------------------------------

> projectVersion :: String
> projectVersion = showVersion version

> copyright :: String
> copyright = unlines [
> "Happy Version " ++ showVersion version ++ " Copyright (c) 1993-1996 Andy Gill, Simon Marlow (c) 1997-2005 Simon Marlow","",
Expand Down

0 comments on commit 6cb1b7d

Please sign in to comment.