bashly 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -33
- data/lib/bashly/concerns/completions.rb +2 -5
- data/lib/bashly/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a6c888335f32b6223149d91ed739e189ffbc6921afec05ff709380c76387338
|
4
|
+
data.tar.gz: b964b4ac7a5fa86f8766b350a3240ee00882be5cfc574e97f001a832a506e342
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1e2757a735e55ffc4d4b27633d6df020184521ed8eb6377c0f26f8edd7442d28fb2a3c56c056de4558aab2204f7d522e15df6374f1962fcbaf26226f590d22b
|
7
|
+
data.tar.gz: a8aa77fba152f005136ff8ee8aacdc7236f15975042c4066f6d94e7e400133e2ca4137ffbbe9bc6f458c2aae2784aa956721d9179862cd78bf95ec6f99f39bd3
|
data/README.md
CHANGED
@@ -349,50 +349,29 @@ functionality to your script in one of three ways:
|
|
349
349
|
|
350
350
|
The bash completions generation is completely automatic, and you will have to
|
351
351
|
rerun the `bashly add comp *` command whenever you change your `bashly.yml`
|
352
|
-
|
352
|
+
file.
|
353
353
|
|
354
354
|
In addition to suggesting subcommands and flags, you can instruct bashly to
|
355
|
-
also suggest files, directories, users and more. To do this,
|
356
|
-
in your `bashly.yml` on the command you wish to alter:
|
355
|
+
also suggest files, directories, users, git branches and more. To do this,
|
356
|
+
add another option in your `bashly.yml` on the command you wish to alter:
|
357
357
|
|
358
358
|
```yaml
|
359
359
|
# bashly.yml
|
360
360
|
commands:
|
361
361
|
- name: upload
|
362
362
|
help: Upload a file
|
363
|
-
completions:
|
363
|
+
completions:
|
364
|
+
- <directory>
|
365
|
+
- <user>
|
366
|
+
- $(git branch 2> /dev/null)
|
364
367
|
|
365
368
|
```
|
366
369
|
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
| `arrayvar` | Array variable names
|
373
|
-
| `binding` | Readline key binding names
|
374
|
-
| `builtin` | Names of shell builtin commands
|
375
|
-
| `command` | Command names
|
376
|
-
| `directory` | Directory names
|
377
|
-
| `disabled` | Names of disabled shell builtins
|
378
|
-
| `enabled` | Names of enabled shell builtins
|
379
|
-
| `export` | Names of exported shell variables
|
380
|
-
| `file` | File names
|
381
|
-
| `function` | Names of shell functions
|
382
|
-
| `group` | Group names
|
383
|
-
| `helptopic` | Help topics as accepted by the help builtin
|
384
|
-
| `hostname` | Hostnames, as taken from the file specified by the HOSTFILE shell variable
|
385
|
-
| `job` | Job names
|
386
|
-
| `keyword` | Shell reserved words
|
387
|
-
| `running` | Names of running jobs
|
388
|
-
| `service` | Service names
|
389
|
-
| `signal` | Signal names
|
390
|
-
| `stopped` | Names of stopped jobs
|
391
|
-
| `user` | User names
|
392
|
-
| `variable` | Names of all shell variables
|
393
|
-
|
394
|
-
Note that these are taken from the [Programmable Completion Builtin][compgen],
|
395
|
-
and will simply be added using the `compgen -A action` command.
|
370
|
+
- Anything between `<...>` will be added using the `compgen -A action` flag.
|
371
|
+
- Anything else, will be appended to the `compgen -W` flag.
|
372
|
+
|
373
|
+
For more information about these custom completions, see the documentation for
|
374
|
+
the [completely][completely] gem.
|
396
375
|
|
397
376
|
|
398
377
|
## Real World Examples
|
@@ -31,18 +31,15 @@ module Bashly
|
|
31
31
|
flags.map(&:name) + flags.map(&:short)
|
32
32
|
end
|
33
33
|
|
34
|
-
def completion_actions
|
35
|
-
completions ? completions.map { |c| "<#{c}>" } : []
|
36
|
-
end
|
37
|
-
|
38
34
|
def completion_words(with_version: false)
|
39
35
|
trivial_flags = %w[--help -h]
|
40
36
|
trivial_flags += %w[--version -v] if with_version
|
41
37
|
all = (
|
42
38
|
command_names + trivial_flags +
|
43
|
-
completion_flag_names
|
39
|
+
completion_flag_names
|
44
40
|
)
|
45
41
|
|
42
|
+
all += completions if completions
|
46
43
|
all.compact.uniq.sort
|
47
44
|
end
|
48
45
|
|
data/lib/bashly/version.rb
CHANGED