Skip to content

Commit

Permalink
chore: Add copyright notice to Bash completion script
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Feb 10, 2025
1 parent 9a6fedc commit 07a6281
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/duty/completions.bash
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Invoke tab-completion script to be sourced with Bash shell.
# Known to work on Bash 3.x, untested on 4.x.
# Taken and adapted from pyinvoke:
# Copyright (c) 2020 Jeff Forcier.
# All rights reserved.

_complete_duty() {
local candidates

# COMP_WORDS contains the entire command string up til now (including
# program name).
# We hand it to Invoke so it can figure out the current context: spit back
# core options, task names, the current task's options, or some combo.
# COMP_WORDS contains the entire command string up til now (including # program name).
# We hand it to Invoke so it can figure out the current context:
# spit back core options, task names, the current task's options, or some combo.
candidates=$(duty --complete -- "${COMP_WORDS[@]}")

# `compgen -W` takes list of valid options & a partial word & spits back
# possible matches. Necessary for any partial word completions (vs
# completions performed when no partial words are present).
# `compgen -W` takes list of valid options & a partial word & spits back possible matches.
# Necessary for any partial word completions
# (vs. completions performed when no partial words are present).
#
# $2 is the current word or token being tabbed on, either empty string or a
# partial word, and thus wants to be compgen'd to arrive at some subset of
Expand Down

0 comments on commit 07a6281

Please sign in to comment.