Skip to content

Commit a722185

Browse files
committed
Add: tool info to output file.
1 parent c012712 commit a722185

File tree

5 files changed

+18
-0
lines changed

5 files changed

+18
-0
lines changed

cmdcomp/v2/completion.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from pathlib import Path
22
from typing import Any
33

4+
from cmdcomp import __version__
45
from cmdcomp.shell import ShellType
56
from cmdcomp.v2.config import V2Config
67

@@ -18,6 +19,7 @@ def generate_v2(shell: ShellType, config: V2Config) -> str:
1819
app_aliases=config.app.aliases + config.root.aliases,
1920
commands={config.app.name: config.root},
2021
append_key_tag=_append_key_tag,
22+
version=__version__,
2123
)
2224

2325

cmdcomp/v2/templates/bash.sh.jinja

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ cur=$COMP_CWORD
9696
{%- endmacro -%}
9797

9898
#!/bin/bash
99+
#
100+
# Code generated by cmdcomp "{{ version }}". DO NOT EDIT.
101+
# For more information about cmdcomp, please refer to https://github.com/yassun4dev/cmdcomp
102+
#
99103

100104
{{ func_name }}() {
101105
local word cmd opts cur cmd_cur opts_cur

cmdcomp/v2/templates/zsh.sh.jinja

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
{%- endmacro -%}
2929

3030
#!/bin/zsh
31+
#
32+
# Code generated by cmdcomp "{{ version }}". DO NOT EDIT.
33+
# For more information about cmdcomp, please refer to https://github.com/yassun4dev/cmdcomp
34+
#
3135

3236
{{ func_name }}() {
3337
local context curcontext=$curcontext state line

samples/v2/output.bash

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/bin/bash
2+
#
3+
# Code generated by cmdcomp "2.0.2". DO NOT EDIT.
4+
# For more information about cmdcomp, please refer to https://github.com/yassun4dev/cmdcomp
5+
#
26

37
_cliname() {
48
local word cmd opts cur cmd_cur opts_cur

samples/v2/output.zsh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/bin/zsh
2+
#
3+
# Code generated by cmdcomp "2.0.2". DO NOT EDIT.
4+
# For more information about cmdcomp, please refer to https://github.com/yassun4dev/cmdcomp
5+
#
26

37
_cliname() {
48
local context curcontext=$curcontext state line

0 commit comments

Comments
 (0)