Skip to content

Commit 8720da6

Browse files
authored
Remove stderr comment output for generate-completion subcommand (#27)
The stderr comment doesn't serve any purpose
1 parent f117e7b commit 8720da6

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [Unreleased]
4+
5+
### Changed
6+
7+
- Remove stderr comment output for `tinty generate-completion`
8+
39
## [0.14.0] - 2024-05-07
410

511
### Added

USAGE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ subcommand, source the generated file in your shell startup file (`*rc`)
2121
and completions will exist for `tinty`. Have a look at the [README CLI
2222
section] for more information about the command usage.
2323

24+
```sh
25+
tinty generate-completion zsh > path/to/tinty-zsh-completion.sh
26+
```
27+
28+
In your startup file (`*rc`) add the following:
29+
30+
```sh
31+
source path/to/tinty-zsh-completion.sh
32+
```
33+
34+
### Completions in the repo
35+
2436
A shell completion generation via `tinty` doesn't include any dynamic
2537
values, meaning scheme names (such as `base16-ocean`) won't be completed
2638
typing `tinty apply base`. We've created modified completion script

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ fn main() -> Result<()> {
8888
Some(("generate-completion", sub_matches)) => {
8989
if let Some(generator) = sub_matches.get_one::<Shell>("shell_name") {
9090
let mut cmd = build_cli();
91-
eprintln!("Generating completion file for {generator}...");
91+
9292
print_completions(*generator, &mut cmd);
9393
return Ok(());
9494
};

tests/cli_generatecompletion_subcommand_tests.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,7 @@ fn generate_shell_completion_test(shell_name: &str) -> Result<String> {
1515
// ---
1616
// Act
1717
// ---
18-
let (stdout, stderr) = utils::run_command(command_vec).unwrap();
19-
20-
// Ok((stdout, stderr, cleanup))
21-
22-
// ------
23-
// Assert
24-
// ------
25-
assert!(
26-
stderr.contains(format!("Generating completion file for {shell_name}...").as_str()),
27-
"stderr does not contain the expected output"
28-
);
18+
let (stdout, _) = utils::run_command(command_vec).unwrap();
2919

3020
cleanup()?;
3121
Ok(stdout)

0 commit comments

Comments
 (0)