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

Remove --offline from commands that don't realize anything and don't query remote resources #7821

Open
roberth opened this issue Feb 13, 2023 · 2 comments
Labels
bug new-cli Relating to the "nix" command

Comments

@roberth
Copy link
Member

roberth commented Feb 13, 2023

Describe the bug

CLI help should be relevant

Steps To Reproduce

Expected behavior

Only show relevant options

nix-env --version output

Additional context

Add any other context about the problem here.

Priorities

Add 👍 to issues you find important.

@roberth roberth added bug new-cli Relating to the "nix" command idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome. labels Feb 13, 2023
@edolstra
Copy link
Member

I think this should remain a global flag. It would be pretty painful to enumerate exactly what commands might access the network. And it doesn't really help the user in any way, since these flags are already listed separately in the manpages.

Also, making global flags non-global means you can't write stuff like this in a script:

extraNixOptions="-v"

if [[ some condition ]];
  extraNixOptions+=" --offline"
fi

nix $extraNixOptions some-command ...
nix $extraNixOptions some-other-command ...

since some of these options would no longer be accepted by all commands.

@edolstra edolstra removed the idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome. label Feb 13, 2023
@roberth
Copy link
Member Author

roberth commented Feb 19, 2023

I think it'd be ok to just hide it from the docs, and on a best-effort basis, so no huge whitelist.

Looks like I mislabeled this, sorry about that, but I see you've fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new-cli Relating to the "nix" command
Projects
None yet
Development

No branches or pull requests

2 participants