Skip to content

Commit f4e0ba4

Browse files
authored
Merge pull request #22808 from nkakkar81/enable-tab-completion-tkn
Enable Tab Completion on tkn
2 parents 0bfada9 + 31d480a commit f4e0ba4

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,8 @@ Topics:
13881388
Topics:
13891389
- Name: Installing tkn
13901390
File: installing-tkn
1391+
- Name: Configuring tkn
1392+
File: op-configuring-tkn
13911393
- Name: Basic tkn commands
13921394
File: op-tkn-reference
13931395
---
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[id="op-configuring-tkn"]
2+
= Configuring the OpenShift Pipelines `tkn` CLI
3+
include::modules/common-attributes.adoc[]
4+
include::modules/pipelines-document-attributes.adoc[]
5+
:context: configuring-tkn
6+
7+
toc::[]
8+
9+
Configure the {pipelines-title} `tkn` CLI to enable tab completion.
10+
11+
// Enabling tab completion
12+
include::modules/op-tkn-enabling-tab-completion.adoc[leveloffset=+1]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * cli_reference/tkn_cli/installing-tkn.adoc
4+
5+
[id="op-tkn-enabling-tab-completion_{context}"]
6+
= Enabling tab completion
7+
8+
After you install the `tkn` CLI, you can enable tab completion to automatically complete `tkn` commands or suggest options when you press Tab.
9+
10+
.Prerequisites
11+
12+
* You must have the `tkn` CLI tool installed.
13+
* You must have `bash-completion` installed on your local system.
14+
15+
.Procedure
16+
17+
The following procedure enables tab completion for Bash.
18+
19+
. Save the Bash completion code to a file:
20+
+
21+
----
22+
$ tkn completion bash > tkn_bash_completion
23+
----
24+
25+
. Copy the file to `/etc/bash_completion.d/`:
26+
+
27+
----
28+
$ sudo cp tkn_bash_completion /etc/bash_completion.d/
29+
----
30+
+
31+
Alternatively, you can save the file to a local directory and source it from your `.bashrc` file instead.
32+
33+
Tab completion is enabled when you open a new terminal.

0 commit comments

Comments
 (0)