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

C API: CLI integration (tracking) #10436

Open
roberth opened this issue Apr 8, 2024 · 0 comments
Open

C API: CLI integration (tracking) #10436

roberth opened this issue Apr 8, 2024 · 0 comments
Labels
c api Nix as a C library with a stable interface feature Feature request or proposal settings Settings, global flags, nix.conf

Comments

@roberth
Copy link
Member

roberth commented Apr 8, 2024

Is your feature request related to a problem? Please describe.

For a close-to-native UX, it'd be good to support many of the CLI features in other languages.

This could take many forms:

  • Functions that return the set of flag strings, as well as their arity (number of subsequent arguments consumed). These can be passed automatically to argument parsing libraries. These functions should ideally not depend on any nix_lib*_init functions.
  • Functions that expose the CLI classes somehow. This would achieve the most Nix-like UX details. This won't be suitable for applications that aren't primarily Nix-focused.
  • Functions that expose the configuration system.
  • Functions that expose the logging system and progress bar.

Describe the solution you'd like

Consider the above, but perhaps only after we've made some progress on the settings system.

Describe alternatives you've considered

  • A function that parses command line flags while ignoring anything that's not recognized by Nix. I don't like such functions, because it assumes that - does not occur in non-flag positions in the host CLI. While this often holds up, it inevitably won't, e.g. --skopeo-flags --remove-signatures. What if Nix also accepts, or worse starts to accept --remove-signatures? It'd filter out --remove-signatures, and whatever argument follows will be passed to skopeo.

Additional context

Priorities

Add 👍 to issues you find important.

@roberth roberth added feature Feature request or proposal settings Settings, global flags, nix.conf c api Nix as a C library with a stable interface labels Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c api Nix as a C library with a stable interface feature Feature request or proposal settings Settings, global flags, nix.conf
Projects
None yet
Development

No branches or pull requests

1 participant