File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ import qualified Options.Applicative as Opt
2020import Cardano.CLI.OS.Posix
2121#endif
2222
23+ import System.Console.Terminal.Size (Window (.. ), size )
24+
2325main :: IO ()
2426main = toplevelExceptionHandler $ do
2527 Crypto. cryptoInit
@@ -30,6 +32,12 @@ main = toplevelExceptionHandler $ do
3032#ifdef UNIX
3133 _ <- setFileCreationMask (otherModes `unionFileModes` groupModes)
3234#endif
33- co <- Opt. customExecParser pref (opts envCli)
35+
36+ mWin <- size
37+
38+ let termWidth = maybe 80 width mWin
39+ dynamicPrefs = pref { Opt. prefColumns = termWidth }
40+
41+ co <- Opt. customExecParser dynamicPrefs (opts envCli)
3442
3543 orDie (docToText . renderClientCommandError) $ runClientCommand co
Original file line number Diff line number Diff line change @@ -305,6 +305,7 @@ executable cardano-cli
305305 cardano-cli,
306306 cardano-crypto-class ^>= 2.2 ,
307307 optparse-applicative-fork,
308+ terminal-size,
308309 transformers-except,
309310
310311library cardano-cli-test-lib
You can’t perform that action at this time.
0 commit comments