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

mention shell completions usage in README.md #853

Open
scarf005 opened this issue Jun 5, 2023 · 3 comments
Open

mention shell completions usage in README.md #853

scarf005 opened this issue Jun 5, 2023 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed kind/doc Document update

Comments

@scarf005
Copy link
Contributor

scarf005 commented Jun 5, 2023

lsd/build.rs

Lines 24 to 36 in 2fe3fcd

let outdir = std::env::var_os("SHELL_COMPLETIONS_DIR")
.or_else(|| std::env::var_os("OUT_DIR"))
.unwrap_or_else(|| exit(0));
fs::create_dir_all(&outdir).unwrap();
let mut app = Cli::command();
let bin_name = "lsd";
generate_to(Bash, &mut app, bin_name, &outdir).expect("Failed to generate Bash completions");
generate_to(Fish, &mut app, bin_name, &outdir).expect("Failed to generate Fish completions");
generate_to(Zsh, &mut app, bin_name, &outdir).expect("Failed to generate Zsh completions");
generate_to(PowerShell, &mut app, bin_name, &outdir)
.expect("Failed to generate PowerShell completions");

despite lsd providing shell completions via clap_complete::generate_to, there is no documentation that either SHELL_COMPLETIONS_DIR or OUT_DIR environment variable needs to be set to generate one.

alternatively, LSD could provide a command-line option to generate completions at runtime.

@zwpaper
Copy link
Member

zwpaper commented Jun 11, 2023

/kind doc
/good-first-issue
/help

@muniu-bot muniu-bot bot added the kind/doc Document update label Jun 11, 2023
@zwpaper
Copy link
Member

zwpaper commented Jun 11, 2023

/good-first-issue
/help

@muniu-bot
Copy link

muniu-bot bot commented Jun 11, 2023

@zwpaper:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

/good-first-issue
/help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@muniu-bot muniu-bot bot added good first issue Good for newcomers help wanted Extra attention is needed labels Jun 11, 2023
zwpaper pushed a commit that referenced this issue Jun 29, 2023
Modified doc/lsd.md to include documentation on SHELL_COMPLETIONS_DIR /
OUT_DIR. This is from issue #853.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed kind/doc Document update
Projects
None yet
Development

No branches or pull requests

2 participants