23 Commits

Author SHA1 Message Date
Rylan Polster
3b63a7eff4
Add brew debugger command 2024-08-14 22:56:26 -04:00
Douglas Eichelberger
5ca1f2579f Annotate AbstractCommand public API 2024-08-13 13:49:42 -07:00
Douglas Eichelberger
a0a7f355d5 Create dummy brew cmd 2024-08-10 11:20:53 -07:00
Ruoyu Zhong
d611e3e0f9
Add ShellCommand module for shell command stubs 2024-07-15 14:48:36 -04:00
Ruoyu Zhong
913ea0e5e4
abstract_command: fix raise_sh_command_error! not being found 2024-07-14 23:12:53 -04:00
Mike McQuaid
5987c5c1d0
Add stub Ruby commands for all Bash commands.
This gets us pretty similar (but easier to manage) manpage output but
much nicer completions etc. for all these commands.
2024-07-14 23:12:53 -04:00
Mike McQuaid
c5dbd3ca24
Rearrange requires
This improves the load time of most brew commands. For an example of
one of the simplest commands this speeds up:

Without Bootsnap:
```
$ hyperfine 'git checkout master; brew help' 'git checkout optimise_requires; brew help'
Benchmark 1: git checkout master; brew help
  Time (mean ± σ):     525.0 ms ±  35.8 ms    [User: 229.9 ms, System: 113.1 ms]
  Range (min … max):   465.3 ms … 576.6 ms    10 runs

Benchmark 2: git checkout optimise_requires; brew help
  Time (mean ± σ):     383.3 ms ±  25.1 ms    [User: 133.0 ms, System: 72.1 ms]
  Range (min … max):   353.0 ms … 443.6 ms    10 runs

Summary
  git checkout optimise_requires; brew help ran
    1.37 ± 0.13 times faster than git checkout master; brew help
```

With Bootsnap:
```
$ hyperfine 'git checkout master; brew help' 'git checkout optimise_requires; brew help'
Benchmark 1: git checkout master; brew help
  Time (mean ± σ):     386.0 ms ±  30.9 ms    [User: 130.2 ms, System: 93.8 ms]
  Range (min … max):   359.5 ms … 469.3 ms    10 runs

Benchmark 2: git checkout optimise_requires; brew help
  Time (mean ± σ):     330.2 ms ±  32.4 ms    [User: 93.4 ms, System: 73.0 ms]
  Range (min … max):   302.9 ms … 413.9 ms    10 runs

Summary
  git checkout optimise_requires; brew help ran
    1.17 ± 0.15 times faster than git checkout master; brew help
```
2024-07-14 08:49:39 -04:00
Markus Reiter
480e264d9a
Lint Ruby docs. 2024-05-01 11:35:21 +02:00
Douglas Eichelberger
7bfa552702 Individually namespace args for each command 2024-04-21 16:51:31 -07:00
Douglas Eichelberger
cb71938fff Enable strict typing in CLI::Parser 2024-04-21 14:16:25 -07:00
Douglas Eichelberger
8ab9d2cbad Port Homebrew::Cmd::Leaves 2024-03-30 16:16:52 -07:00
Douglas Eichelberger
c50fb2dbd2 Remove redundant cli/parser requires 2024-03-29 18:53:07 -07:00
Douglas Eichelberger
821f2a5ab5 Automagically remove -cmd suffix 2024-03-21 19:55:35 -07:00
Douglas Eichelberger
bf9ebccecd Handle dashed commands 2024-03-20 10:36:19 -07:00
Douglas Eichelberger
cae62e0175 Update Command API 2024-03-20 10:16:17 -07:00
Douglas Eichelberger
131a5421a5 Make cmd_args block non-nilable 2024-03-16 11:14:39 -07:00
Douglas Eichelberger
23336aa316 Update tests 2024-03-15 12:58:59 -07:00
Douglas Eichelberger
aad08cd5a4 Revert using hash accessors for args 2024-03-15 12:51:03 -07:00
Douglas Eichelberger
6fc99d9569 Add tests 2024-03-15 12:46:06 -07:00
Douglas Eichelberger
7d34717ccd Search subclasses instead of using registry 2024-03-15 12:46:06 -07:00
Douglas Eichelberger
fd652148fa Implement cmd_args block 2024-03-15 12:46:05 -07:00
Douglas Eichelberger
5364b6ef03 Use a command registry 2024-03-15 12:46:05 -07:00
Douglas Eichelberger
cbcb221de6 Create AbstractCommand class 2024-03-15 12:46:05 -07:00