Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ gemspec
# Needed for the CLI only
group :runtime, :cli do
gem 'dry-cli', '~> 1.4' # for arg parsing
gem 'dry-cli-completion', '~> 2.0' # for shell completion
gem 'paint', '~> 2.3' # for colorized ouput
end

Expand Down
18 changes: 16 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ PATH
specs:
unisec (0.0.8)
ctf-party (~> 5.0)
dry-cli (~> 1.0)
dry-cli (~> 1.4)
dry-cli-completion (~> 2.0.0)
paint (~> 2.3)
twitter_cldr (~> 6.13)
unicode-confusable (~> 1.12)
unicode-confusable (~> 1.13)

GEM
remote: https://rubygems.org/
Expand All @@ -18,7 +19,11 @@ GEM
cgi (0.5.1)
cldr-plurals-runtime-rb (1.1.0)
coderay (1.1.3)
colsole (1.0.1)
commonmarker (2.8.2-x86_64-linux)
completely (0.7.5)
colsole (~> 1.0.0)
mister_bin (~> 0.7)
concurrent-ruby (1.3.6)
ctf-party (5.0.0)
base64 (~> 0.2.0)
Expand All @@ -27,8 +32,12 @@ GEM
uri (~> 1.1)
date (3.5.1)
docopt (0.6.1)
docopt_ng (0.7.1)
drb (2.2.3)
dry-cli (1.4.1)
dry-cli-completion (2.0.0)
completely (~> 0.7)
dry-cli (~> 1.4)
erb (6.0.4)
io-console (0.8.2)
irb (1.18.0)
Expand All @@ -45,6 +54,10 @@ GEM
prism (~> 1.5)
minitest-skip (1.0.0)
minitest (~> 6.0)
mister_bin (0.9.0)
colsole (~> 1.0.0)
docopt_ng (~> 0.7.1)
reline (~> 0.6)
ostruct (0.6.3)
paint (2.3.0)
parallel (2.1.0)
Expand Down Expand Up @@ -112,6 +125,7 @@ DEPENDENCIES
commonmarker (~> 2.8)
ctf-party (~> 5.0)
dry-cli (~> 1.4)
dry-cli-completion (~> 2.0)
irb
logger
minitest (~> 6.0)
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- New utils method:
- `Unisec::Utils::Arguments.to_array_of_sym`
- `Unisec::Utils::Arguments.argenc2enc`
- Add shell completion for CLI

**Chore**

Expand Down
25 changes: 25 additions & 0 deletions docs/pages/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,28 @@ ruby -Ilib -runisec bin/unisec
```

<!-- tabs:end -->

## Shell completion

<!-- tabs:start -->

### **zsh**

Add in `~/.zshrc`

```bash
source <(unisec completion zsh)
```

### **bash**

Add in `~/.bashrc`

```bash
# bash 3.0+
source <(unisec completion bash)
# else
eval "$(unisec completion bash)"
```

<!-- tabs:end -->
2 changes: 2 additions & 0 deletions lib/unisec/cli/cli.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require 'dry/cli/completion/command'
require 'unisec/cli/bidi'
require 'unisec/cli/blocks'
require 'unisec/cli/confusables'
Expand All @@ -25,6 +26,7 @@ module Commands
register 'blocks invalid', Blocks::Invalid
register 'blocks list', Blocks::List
register 'blocks search', Blocks::Search
register 'completion', Dry::CLI::Completion::Command[self]
register 'confusables list', Confusables::List
register 'confusables randomize', Confusables::Randomize
register 'dump codepoints integer', Dump::Codepoints::Integer
Expand Down
5 changes: 3 additions & 2 deletions unisec.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ Gem::Specification.new do |s|
s.required_ruby_version = ['>= 3.3.0', '< 5.0']

s.add_runtime_dependency('ctf-party', '~> 5.0') # string conversion
s.add_runtime_dependency('dry-cli', '~> 1.0') # CLI
s.add_runtime_dependency('dry-cli', '~> 1.4') # CLI
s.add_runtime_dependency('dry-cli-completion', '~> 2.0.0') # shell completion
s.add_runtime_dependency('paint', '~> 2.3') # colorized output
s.add_runtime_dependency('twitter_cldr', '~> 6.13') # ICU / CLDR
s.add_runtime_dependency('unicode-confusable', '~> 1.12') # confusable chars
s.add_runtime_dependency('unicode-confusable', '~> 1.13') # confusable chars
end
Loading