Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ expensive_tests = []
# "test_risky_names" == enable tests that create problematic file names (would make a network share inaccessible to Windows, breaks SVN on Mac OS, etc.)
test_risky_names = []
# * only build `uudoc` when `--feature uudoc` is activated
uudoc = ["zip", "dep:fluent-syntax"]
uudoc = ["clap_complete", "clap_mangen", "fluent-syntax", "zip", "feat_Tier1"]
## features
## Optional feature for stdbuf
# "feat_external_libstdbuf" == use an external libstdbuf.so for stdbuf instead of embedding it
Expand Down Expand Up @@ -408,14 +408,14 @@ uutests = { version = "0.3.0", package = "uutests", path = "tests/uutests" }

[dependencies]
clap.workspace = true
uucore.workspace = true
clap_complete.workspace = true
clap_mangen.workspace = true
clap_complete = { workspace = true, optional = true }
clap_mangen = { workspace = true, optional = true }
fluent-syntax = { workspace = true, optional = true }
phf.workspace = true
selinux = { workspace = true, optional = true }
textwrap.workspace = true
uucore.workspace = true
zip = { workspace = true, optional = true }
fluent-syntax = { workspace = true, optional = true }


# * uutils
Expand Down
18 changes: 11 additions & 7 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ TEST_PROGS := \
unexpand \
uniq \
unlink \
uudoc \
wc \
who

Expand Down Expand Up @@ -406,10 +407,13 @@ distclean: clean
$(CARGO) clean $(CARGOFLAGS) && $(CARGO) update $(CARGOFLAGS)

ifeq ($(MANPAGES),y)
manpages: build-coreutils
build-uudoc:
${CARGO} build ${CARGOFLAGS} --bin uudoc --features "uudoc ${EXES}" ${PROFILE_CMD} --no-default-features

manpages: build-coreutils build-uudoc
mkdir -p $(BUILDDIR)/man/
$(foreach prog, $(INSTALLEES) $(HASHSUM_PROGS), \
$(BUILDDIR)/coreutils manpage $(prog) > $(BUILDDIR)/man/$(PROG_PREFIX)$(prog).1 $(newline) \
$(BUILDDIR)/uudoc manpage $(prog) > $(BUILDDIR)/man/$(PROG_PREFIX)$(prog).1 $(newline) \
)

install-manpages: manpages
Expand All @@ -422,12 +426,12 @@ install-manpages:
endif

ifeq ($(COMPLETIONS),y)
completions: build-coreutils
completions: build-coreutils build-uudoc
mkdir -p $(BUILDDIR)/completions/zsh $(BUILDDIR)/completions/bash $(BUILDDIR)/completions/fish
$(foreach prog, $(INSTALLEES) $(HASHSUM_PROGS) , \
$(BUILDDIR)/coreutils completion $(prog) zsh > $(BUILDDIR)/completions/zsh/_$(PROG_PREFIX)$(prog) $(newline) \
$(BUILDDIR)/coreutils completion $(prog) bash > $(BUILDDIR)/completions/bash/$(PROG_PREFIX)$(prog) $(newline) \
$(BUILDDIR)/coreutils completion $(prog) fish > $(BUILDDIR)/completions/fish/$(PROG_PREFIX)$(prog).fish $(newline) \
$(BUILDDIR)/uudoc completion $(prog) zsh > $(BUILDDIR)/completions/zsh/_$(PROG_PREFIX)$(prog) $(newline) \
$(BUILDDIR)/uudoc completion $(prog) bash > $(BUILDDIR)/completions/bash/$(PROG_PREFIX)$(prog) $(newline) \
$(BUILDDIR)/uudoc completion $(prog) fish > $(BUILDDIR)/completions/fish/$(PROG_PREFIX)$(prog).fish $(newline) \
)

install-completions: completions
Expand Down Expand Up @@ -520,4 +524,4 @@ endif
rm -f $(addprefix $(DESTDIR)$(DATAROOTDIR)/fish/vendor_completions.d/$(PROG_PREFIX),$(addsuffix .fish,$(PROGS)))
rm -f $(addprefix $(DESTDIR)$(DATAROOTDIR)/man/man1/$(PROG_PREFIX),$(addsuffix .1,$(PROGS)))

.PHONY: all build build-coreutils build-pkgs test distclean clean busytest install uninstall
.PHONY: all build build-coreutils build-pkgs build-uudoc test distclean clean busytest install uninstall
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,33 +252,41 @@ The `coreutils` binary can generate completions for the `bash`, `elvish`,
The syntax is:

```shell
cargo run completion <utility> <shell>
# Install uudoc first
cargo install --bin uudoc --features uudoc --path .

# Then use the installed binary
uudoc completion <utility> <shell>
```

So, to install completions for `ls` on `bash` to
`/usr/local/share/bash-completion/completions/ls`, run:

```shell
cargo run completion ls bash > /usr/local/share/bash-completion/completions/ls
uudoc completion ls bash > /usr/local/share/bash-completion/completions/ls
```

Completion for prefixed `cp` with `uu-` on `zsh` is generated by
```shell
env PROG_PREFIX=uu- cargo run completion cp zsh
env PROG_PREFIX=uu- uudoc completion cp zsh
```

### Manually install manpages

To generate manpages, the syntax is:

```bash
cargo run manpage <utility>
# Install uudoc first
cargo install --bin uudoc --features uudoc --path .

# Then use the installed binary
uudoc manpage <utility>
```

So, to install the manpage for `ls` to `/usr/local/share/man/man1/ls.1` run:

```bash
cargo run manpage ls > /usr/local/share/man/man1/ls.1
uudoc manpage ls > /usr/local/share/man/man1/ls.1
```

## Un-installation
Expand Down
5 changes: 3 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

// spell-checker:ignore (vars) krate
// spell-checker:ignore (vars) krate mangen

use std::env;
use std::fs::File;
Expand Down Expand Up @@ -32,7 +32,8 @@ pub fn main() {
// Allow this as we have a bunch of info in the comments
#[allow(clippy::match_same_arms)]
match krate.as_ref() {
"default" | "macos" | "unix" | "windows" | "selinux" | "zip" => continue, // common/standard feature names
"default" | "macos" | "unix" | "windows" | "selinux" | "zip" | "clap_complete"
| "clap_mangen" | "fluent_syntax" => continue, // common/standard feature names
"nightly" | "test_unimplemented" | "expensive_tests" | "test_risky_names" => {
continue;
} // crate-local custom features
Expand Down
26 changes: 26 additions & 0 deletions fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading