Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flags to --version output #5521

Open
wants to merge 1 commit into
base: 2.4
from

Conversation

Projects
None yet
3 participants
@phadej
Copy link
Collaborator

phadej commented Aug 14, 2018

% .../cabal --version
cabal-install version 2.4.0.0
compiled using version 2.4.0.0 of the Cabal library 
flags enabled: native-dns, lib, monolithic
@23Skidoo
Copy link
Member

23Skidoo left a comment

LGTM modulo minor comments.

@@ -288,6 +288,30 @@ mainWorker args = do
++ "\ncompiled using version "
++ display cabalVersion
++ " of the Cabal library "
++ flags_enabled
where
flags_enabled | null enabledFlags = "\nall flags disabled"

This comment has been minimized.

Copy link
@23Skidoo

23Skidoo Aug 14, 2018

Member

I'd rather have it say flags enabled: none.

| otherwise = "\nflags enabled: " ++ intercalate ", " enabledFlags
enabledFlags =
#ifdef CABAL_FLAG_NATIVEDNS
"native-dns" :

This comment has been minimized.

Copy link
@23Skidoo

23Skidoo Aug 14, 2018

Member

Maybe even render them as -fnative-dns, -flib, etc.

This comment has been minimized.

Copy link
@hvr

hvr Aug 14, 2018

Member

@23Skidoo then you could also enumerate all known flags explicitly everytime using the more explicit --flags= syntax:

--flags="-native-dns +lib -monolithic"

This comment has been minimized.

Copy link
@23Skidoo

23Skidoo Aug 14, 2018

Member

That's even better!

@23Skidoo

This comment has been minimized.

Copy link
Member

23Skidoo commented Aug 14, 2018

Also there should be a comment somewhere in cabal-install.cabal reminding you to update the --help output when adding a new flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.