completely 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ab14df9d4065650b0e776ea29552ef7cc01670bcac03e1ff180bb97412c2099
4
- data.tar.gz: 3b0ba408058696ccf0b8d01c5ec230057900d1e9af246144a829229cce098705
3
+ metadata.gz: 8afc0f96ec2612d016fd4a9914b7257f18c2b9e8302b7579129dab4fcaa2ebf1
4
+ data.tar.gz: f94b94f03d432c374f11c006f089f31e78b24aab124f3abf996e4a13f96fdcf5
5
5
  SHA512:
6
- metadata.gz: b94ccf5f12af3764620cb90b0da5bee7a3306f7dd9f39b0b47e0715d7198cc96ca147c64a8eff243d555abb9ee52398a437f053499837df1563eef3d655f86d9
7
- data.tar.gz: a5d7ea400c07344a899a33c55a84263cc5cf146f7039e8ed11e02e7ee728f326a19aa20c999c975f7d75046d998095a6a25e84815319fd06d5bc11d5fdb12ebf
6
+ metadata.gz: 88f5725ccbd2532d6270e8de9cba476ca14a37917bc87b0dd284928cf27a7c08ca6fcdca54c5fa49d7fb63c74197617f81c641ded2f91fa74d5c6c1ec9bf33bc
7
+ data.tar.gz: 78ee662b15cc64f7172410c6f28aa2ed55f1224aaa0e66700c51380cc36e6ad6fbc4740d11cf4387e58c683d0050122d47d88b4f93a9031a6065c1e359a36b8d
data/README.md CHANGED
@@ -40,6 +40,7 @@ or with Docker:
40
40
  $ alias completely='docker run --rm -it --user $(id -u):$(id -g) --volume "$PWD:/app" dannyben/completely'
41
41
  ```
42
42
 
43
+
43
44
  ## Configuration syntax
44
45
 
45
46
  Completely works with a simple YAML configuration file as input, and generates
@@ -246,6 +247,7 @@ The rules here are as follows:
246
247
  hash key (e.g., `+--branch` or `"*--branch"`). Note that when using a `*`,
247
248
  the hash key must be quoted since asterisks have special meaning in YAML.
248
249
 
250
+
249
251
  ## Using the generated completion scripts
250
252
 
251
253
  In order to enable the completions, simply source the generated script:
@@ -268,6 +270,7 @@ Alternatively, you can copy the script manually to one of these directories
268
270
  - `/usr/local/etc/bash_completion.d`
269
271
  - `~/.local/share/bash-completion/completions`
270
272
 
273
+
271
274
  ## Testing and debugging completion scripts
272
275
 
273
276
  You can use the built in completions script tester by running `completely test`.
@@ -305,6 +308,7 @@ puts completions.wrapper_function "custom_function_name"
305
308
  p completions.tester.test "mygit status "
306
309
  ```
307
310
 
311
+
308
312
  ## Completions in ZSH
309
313
 
310
314
  If you are using Oh-My-Zsh, bash completions should already be enabled,
@@ -317,6 +321,17 @@ autoload -Uz +X compinit && compinit
317
321
  autoload -Uz +X bashcompinit && bashcompinit
318
322
  ```
319
323
 
324
+ ## Customizing the `complete` command
325
+
326
+ In case you wish to customize the `complete` command call in the generated
327
+ script, you can do so by adding any additional flags to the `completely.yaml`
328
+ configuration file using the special `completely_options` key. For example:
329
+
330
+ ```yaml
331
+ completely_options:
332
+ complete_options: -o nosort
333
+ ```
334
+
320
335
  ## Contributing / Support
321
336
 
322
337
  If you experience any issue, have a question or a suggestion, or if you wish
@@ -81,5 +81,12 @@ module Completely
81
81
  def pattern_prefixes
82
82
  patterns.map(&:prefix)
83
83
  end
84
+
85
+ def complete_options_line
86
+ options = config.options[:complete_options]
87
+ return nil if options.nil? || options.strip.empty?
88
+
89
+ "#{options} "
90
+ end
84
91
  end
85
92
  end
@@ -1,6 +1,6 @@
1
1
  module Completely
2
2
  class Config
3
- attr_reader :config
3
+ attr_reader :config, :options
4
4
 
5
5
  class << self
6
6
  def load(config_path)
@@ -17,6 +17,7 @@ module Completely
17
17
  end
18
18
 
19
19
  def initialize(config)
20
+ @options = config.delete('completely_options')&.transform_keys(&:to_sym) || {}
20
21
  @config = config
21
22
  end
22
23
 
@@ -44,6 +44,6 @@
44
44
  % end
45
45
  esac
46
46
  } &&
47
- complete -F <%= function_name %> <%= command %>
47
+ complete <%= complete_options_line %>-F <%= function_name %> <%= command %>
48
48
 
49
49
  # ex: filetype=sh
@@ -1,3 +1,3 @@
1
1
  module Completely
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: completely
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-29 00:00:00.000000000 Z
10
+ date: 2025-04-04 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: colsole
@@ -81,7 +80,6 @@ metadata:
81
80
  changelog_uri: https://github.com/DannyBen/completely/blob/master/CHANGELOG.md
82
81
  source_code_uri: https://github.com/DannyBen/completely
83
82
  rubygems_mfa_required: 'true'
84
- post_install_message:
85
83
  rdoc_options: []
86
84
  require_paths:
87
85
  - lib
@@ -96,8 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
94
  - !ruby/object:Gem::Version
97
95
  version: '0'
98
96
  requirements: []
99
- rubygems_version: 3.5.23
100
- signing_key:
97
+ rubygems_version: 3.6.3
101
98
  specification_version: 4
102
99
  summary: Bash Completions Generator
103
100
  test_files: []