Skip to content

uudoc: write manpages and completions to a directory - #15402

Open
limadog9 wants to merge 1 commit into
uutils:mainfrom
limadog9:fix/uudoc-output-directory
Open

limadog9 wants to merge 1 commit into
uutils:mainfrom
limadog9:fix/uudoc-output-directory

Conversation

@limadog9

Copy link
Copy Markdown
Contributor

Add –out-dir for manpages and shell completions, with regression tests and updated examples.

Closes #14363.

@oech3

oech3 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Thanks. But I prefer generating all completions for all shells with uudoc completion --out-dir /usr/share.

@oech3

This comment was marked as resolved.

@limadog9
limadog9 force-pushed the fix/uudoc-output-directory branch from 602dc98 to ed1a68b Compare October 16, 2026 02:58
@limadog9

Copy link
Copy Markdown
Contributor Author

Thanks @oech3! Addressed the feedback and pushed the updates.

This is why elevators should run on Rust. Rust catches the problems before the elevator moves. Python waits until you’re halfway between floors to let you know something went wrong. 🦀

Comment thread .github/workflows/CICD.yml Outdated
run: |
mkdir -p share/{man/man1,bash-completion/completions,fish/vendor_completions.d,zsh/site-functions,elvish/lib}
_uudoc=target/${{ matrix.job.target }}/release/uudoc
for bin in $('target/${{ matrix.job.target }}/release/coreutils' --list) coreutils;do

This comment was marked as resolved.

This comment was marked as resolved.

Comment thread .github/workflows/CICD.yml Outdated
run: |
mkdir -p share/{man/man1,bash-completion/completions,fish/vendor_completions.d,zsh/site-functions,elvish/lib}
_uudoc=target/${{ matrix.job.target }}/release/uudoc
for bin in $('target/${{ matrix.job.target }}/release/coreutils' --list) coreutils;do

This comment was marked as resolved.

Comment thread .github/workflows/CICD.yml Outdated
${_uudoc} completion ${bin} fish > share/fish/vendor_completions.d/${bin}.fish
${_uudoc} completion ${bin} zsh > share/zsh/site-functions/_${bin}
${_uudoc} completion ${bin} elvish > share/elvish/lib/${bin}.elv
"${_uudoc}" manpage "${bin}" --out-dir share/man/man1

This comment was marked as resolved.

Comment thread GNUmakefile Outdated
build-uudoc:
@unset CARGO_BUILD_TARGET && ${CARGO} build ${CARGOFLAGS} --bin uudoc --features "uudoc ${EXES}" ${PROFILE_CMD} --no-default-features

ifeq ($(MANPAGES),y)

This comment was marked as resolved.

@limadog9
limadog9 force-pushed the fix/uudoc-output-directory branch from ed1a68b to 8de969b Compare October 16, 2026 03:19
@limadog9

limadog9 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @oech3 — addressed all four points. uudoc generate --out-dir DIR now generates all manpages and shell completions together. CI uses that single command without the loop or ${bin} argument, and Make now uses UUDOC and install-docs. Updated the related workflows and README too.

All 36 local tests and installation/packaging checks pass. Squashed into one commit and pushed

@oech3

This comment was marked as resolved.

Comment thread src/bin/uudoc.rs Outdated
Comment on lines +106 to +107
println!(" manpage [utility] [--out-dir DIR] Generate manpages");
println!(" completion [utility] [shell] [--out-dir DIR] Generate shell completions");

This comment was marked as resolved.

@limadog9
limadog9 force-pushed the fix/uudoc-output-directory branch 2 times, most recently from 83c373e to ab97352 Compare October 16, 2026 03:39
@limadog9

Copy link
Copy Markdown
Contributor Author

Thanks @oech3 — renamed the command to manpages-and-completions and removed stdout output. All manpage/completion commands now require --out-dir. Updated the docs, tests, and build scripts, then squashed and pushed. All 35 local tests and installation/packaging checks pass.

Comment thread src/bin/uudoc.rs Outdated
Comment on lines +108 to +109
println!(" manpage [utility] --out-dir DIR Generate manpages");
println!(" completion [utility] [shell] --out-dir DIR Generate shell completions");

This comment was marked as resolved.

@limadog9
limadog9 force-pushed the fix/uudoc-output-directory branch from ab97352 to d4c2220 Compare October 16, 2026 03:53
@limadog9

Copy link
Copy Markdown
Contributor Author

Thanks @oech3 — removed the separate manpage and completion commands and their parsers. Everything now uses manpages-and-completions. Updated the docs and tests, squashed, and pushed. All 30 local tests and installation/packaging checks pass.

Comment thread src/bin/uudoc.rs Outdated
);
println!(
" manpages-and-completions --out-dir DIR [utility]... Generate manpages and shell completions"
);

This comment was marked as resolved.

Comment thread src/bin/uudoc.rs Outdated
Shell::Fish => "fish/vendor_completions.d",
Shell::PowerShell => "powershell",
Shell::Zsh => "zsh/site-functions",
_ => return Err(io::Error::other(format!("unsupported shell: {shell}"))),

This comment was marked as resolved.

@limadog9
limadog9 force-pushed the fix/uudoc-output-directory branch from d4c2220 to ee7977b Compare October 16, 2026 05:22
@limadog9

Copy link
Copy Markdown
Contributor Author

Thanks @oech3 — restored the original help-text spacing and changed the shell fallback to unreachable!(). Squashed and pushed.

@oech3

oech3 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Perhaps, It might better to accept uudoc subcommands --usr /usr e.g. uudoc manpages md completions symlink-coreutils locales --usr /usr. (last 2 subcommands are just examples for the future, this PR does not need to support).

Then /usr/share/docs/coreutils/ls.md is installed...?

@limadog9
limadog9 force-pushed the fix/uudoc-output-directory branch from ee7977b to ac1b782 Compare October 16, 2026 13:41
Comment thread src/bin/uudoc.rs Outdated
println!(" completion <utility> <shell> Generate shell completions for a utility");
println!(" manpages md completions --usr DIR Generate the selected documentation formats");
println!(" Use --out-dir DIR to override the shared-data directory.");
println!(" Use --utilities NAME... to select utilities (default: all compiled utilities).");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to select some utils only.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also reply to each thread instead.

@limadog9
limadog9 force-pushed the fix/uudoc-output-directory branch from ac1b782 to 934680e Compare October 16, 2026 14:05
@oech3

oech3 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Drop --out-dir as --usr is enough. Generally, we should keep options minimal for easier maintainance.

@limadog9
limadog9 force-pushed the fix/uudoc-output-directory branch from 934680e to 0c1e6e6 Compare October 16, 2026 14:33
@limadog9

Copy link
Copy Markdown
Contributor Author

Removed --out-dir; --usr is now the only destination option. Updated Make, README, and tests. Make stages the generated files to preserve custom installation paths.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uudoc: add a feature to write mans and completions to the directory

2 participants