Skip to content

Commit 88445d0

Browse files
committed
Add fancy version info
1 parent 9132dcd commit 88445d0

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

dconf2nix.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 2.4
22

33
name: dconf2nix
4-
version: 0.1.0.0
4+
version: 0.0.1
55
synopsis: Convert dconf files to Nix, as expected by Home Manager.
66
description: A convenient converter of DConf files to Nix, as expected by Home Manager's dconf settings. So you can Nixify your Gnome Shell configuration ;)
77
bug-reports: https://github.com/gvolpe/dconf2nix/issues

src/CommandLine.hs

+21-4
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,32 @@ args =
2727
"Path to the Nix output file (to be created)"
2828
)
2929
)
30-
<*> flag Normal
31-
Verbose
32-
(long "verbose" <> short 'v' <> help "Verbose mode (debug)")
30+
<*> flag Normal Verbose (long "verbose" <> help "Verbose mode (debug)")
31+
32+
versionInfo :: String
33+
versionInfo = unlines
34+
[ ""
35+
, "██████╗ ██████╗ ██████╗ ███╗ ██╗███████╗██████╗ ███╗ ██╗██╗██╗ ██╗"
36+
, "██╔══██╗██╔════╝██╔═══██╗████╗ ██║██╔════╝╚════██╗████╗ ██║██║╚██╗██╔╝"
37+
, "██║ ██║██║ ██║ ██║██╔██╗ ██║█████╗ █████╔╝██╔██╗ ██║██║ ╚███╔╝ "
38+
, "██║ ██║██║ ██║ ██║██║╚██╗██║██╔══╝ ██╔═══╝ ██║╚██╗██║██║ ██╔██╗ "
39+
, "██████╔╝╚██████╗╚██████╔╝██║ ╚████║██║ ███████╗██║ ╚████║██║██╔╝ ██╗"
40+
, "╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚══════╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝"
41+
, ""
42+
, "Version: 0.0.1"
43+
, "Maintainer: Gabriel Volpe"
44+
, "Source code: https://github.com/gvolpe/dconf2nix"
45+
]
46+
47+
version :: Parser (a -> a)
48+
version = infoOption versionInfo
49+
(long "version" <> short 'v' <> help "Show the current version")
3350

3451
runArgs :: IO Args
3552
runArgs = execParser opts
3653
where
3754
opts = info
38-
(args <**> helper)
55+
(helper <*> version <*> args)
3956
( fullDesc
4057
<> progDesc
4158
"Convert a dconf file into a Nix file, as expected by Home Manager."

0 commit comments

Comments
 (0)