From 606d992fc8970372486c7621afbdc3f113408fdc Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 5 Aug 2021 21:51:03 -1000 Subject: [PATCH] cli: disable no-longer-used --binary-filename flag It was still supported (as a hidden flag) by hledger-web, and now is not. --- hledger-ui/Hledger/UI/Main.hs | 2 +- hledger-web/Hledger/Web/Main.hs | 2 +- hledger-web/Hledger/Web/WebOptions.hs | 13 +++++++------ hledger/Hledger/Cli/Version.hs | 24 +++++++++++++----------- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/hledger-ui/Hledger/UI/Main.hs b/hledger-ui/Hledger/UI/Main.hs index 30182a091..2edc49102 100644 --- a/hledger-ui/Hledger/UI/Main.hs +++ b/hledger-ui/Hledger/UI/Main.hs @@ -55,7 +55,7 @@ main = do _ | "info" `inRawOpts` rawopts -> runInfoForTopic "hledger-ui" Nothing _ | "man" `inRawOpts` rawopts -> runManForTopic "hledger-ui" Nothing _ | "version" `inRawOpts` rawopts -> putStrLn prognameandversion - _ | "binary-filename" `inRawOpts` rawopts -> putStrLn (binaryfilename progname) + -- _ | "binary-filename" `inRawOpts` rawopts -> putStrLn (binaryfilename progname) _ -> withJournalDo copts' (runBrickUi opts) runBrickUi :: UIOpts -> Journal -> IO () diff --git a/hledger-web/Hledger/Web/Main.hs b/hledger-web/Hledger/Web/Main.hs index b6e683fca..3b899e7cd 100644 --- a/hledger-web/Hledger/Web/Main.hs +++ b/hledger-web/Hledger/Web/Main.hs @@ -57,7 +57,7 @@ hledgerWebMain = do | "info" `inRawOpts` rawopts_ -> runInfoForTopic "hledger-web" Nothing | "man" `inRawOpts` rawopts_ -> runManForTopic "hledger-web" Nothing | "version" `inRawOpts` rawopts_ -> putStrLn prognameandversion >> exitSuccess - | "binary-filename" `inRawOpts` rawopts_ -> putStrLn (binaryfilename progname) + -- | "binary-filename" `inRawOpts` rawopts_ -> putStrLn (binaryfilename progname) | "test" `inRawOpts` rawopts_ -> do -- remove --test and --, leaving other args for hspec filter (not . (`elem` ["--test","--"])) <$> getArgs >>= flip withArgs hledgerWebTest diff --git a/hledger-web/Hledger/Web/WebOptions.hs b/hledger-web/Hledger/Web/WebOptions.hs index 8e4dcbd9e..5a180009c 100644 --- a/hledger-web/Hledger/Web/WebOptions.hs +++ b/hledger-web/Hledger/Web/WebOptions.hs @@ -97,12 +97,13 @@ webmode = Group { groupUnnamed = webflags , groupHidden = - hiddenflags ++ - [ flagNone - ["binary-filename"] - (setboolopt "binary-filename") - "show the download filename for this executable, and exit" - ] + hiddenflags + -- ++ + -- [ flagNone + -- ["binary-filename"] + -- (setboolopt "binary-filename") + -- "show the download filename for this executable, and exit" + -- ] , groupNamed = [generalflagsgroup1] } , modeHelpSuffix = [] diff --git a/hledger/Hledger/Cli/Version.hs b/hledger/Hledger/Cli/Version.hs index 7bb00bbfa..72c895160 100644 --- a/hledger/Hledger/Cli/Version.hs +++ b/hledger/Hledger/Cli/Version.hs @@ -9,7 +9,7 @@ module Hledger.Cli.Version ( version, prognameandversion, versiondescription, - binaryfilename, + -- binaryfilename, ) where @@ -32,6 +32,8 @@ version = VERSION #else version = "dev build" #endif + +prognameandversion :: String prognameandversion = versiondescription progname -- developer build version strings include PATCHLEVEL (number of @@ -72,13 +74,13 @@ versiondescription progname = concat | os == "mingw32" = "windows" | otherwise = os --- | Given a program name, return a precise platform-specific executable --- name suitable for naming downloadable binaries. Can raise an error if --- the version and patch level was not defined correctly at build time. -binaryfilename :: String -> String -binaryfilename progname = concat - [progname, "-", buildversion, "-", os', "-", arch, suffix] - where - (os',suffix) | os == "darwin" = ("mac","" :: String) - | os == "mingw32" = ("windows",".exe") - | otherwise = (os,"") +-- -- | Given a program name, return a precise platform-specific executable +-- -- name suitable for naming downloadable binaries. Can raise an error if +-- -- the version and patch level was not defined correctly at build time. +-- binaryfilename :: String -> String +-- binaryfilename progname = concat +-- [progname, "-", buildversion, "-", os', "-", arch, suffix] +-- where +-- (os',suffix) | os == "darwin" = ("mac","" :: String) +-- | os == "mingw32" = ("windows",".exe") +-- | otherwise = (os,"")