uutils / uutils/coreutils

`cp`: compile without `clap` (for nushell)

Open
#5,203 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #5358 by @tommady — closed without merging
U - cp wontfix
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

Context: https://github.com/nushell/nushell/pull/10097

All the utils include a clap-based argument parser. If we want to expose the internals of the utils, it should also be possible to only compile the internals without the argument parser and the clap dependency. This is a request from nushell, where they want to reuse our utils with their own argument parsing.

So, we should introduce a feature (e.g. called "cli", "parser" or "uumain", I'm not sure), which enables the uumain function and the clap parser. This should probably be enabled by default (nushell can then include it with default-features = false).

To compile entirely without clap, uucore also needs to be able to compile without clap. This issue is therefore also relevant: https://github.com/uutils/coreutils/issues/5202.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the utility crates' uumain entry point and their clap usage, then inspect closed pull request #5358 and the related uutils/coreutils issue #5202. Done means a default-enabled feature provides the CLI parser while disabling default features allows the utility internals and uucore to compile without clap.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.