Commit Graph
40 Commits
Author SHA1 Message Date
Bo Anderson e3372e2a14 Lazily require some heavy files 2020-08-20 02:05:17 +01:00
Markus Reiter 4c833b241d Fix parsing of negative options. 2020-08-14 20:03:15 +02:00
Markus Reiter b48bc316e0 Use CLI::Parser for cask commands. 2020-08-13 05:15:15 +02:00
Markus Reiter 9d6350037f Use try instead of send. 2020-08-06 16:13:14 +02:00
Bo Anderson 5e98d4df08 cli/parser: restore env setting for global options 2020-08-01 17:36:16 +01:00
Markus Reiter 0de9eb0382 Rename split_double_dash to split_non_options. 2020-07-31 17:46:54 +02:00
Markus Reiter be2d19fe07 Refactor handling of formula options in CLI::Parser. 2020-07-31 17:46:54 +02:00
Markus Reiter 4381c32524 Add test for parsing with ignore_invalid_options. 2020-07-31 15:07:17 +02:00
Markus Reiter d4c2ffd705 Refactor CLI::Parser. 2020-07-31 15:07:17 +02:00
Markus Reiter 24eff8f81a Pass args in SoftwareSpec instead of using global args. 2020-07-30 03:21:12 +02:00
Markus Reiter c0d42dd922 Remove --force from global_options. 2020-07-28 10:31:11 +02:00
Markus Reiter bf13db3367 Make Parser#parse return args. 2020-07-25 02:37:10 +02:00
Jonathan Chang 76709d82c5 Fix brew style. 2020-07-13 23:24:14 +10:00
Mike McQuaid ef95b59ed4 Remove HomebrewArgvExtension
Fixes #5730
2020-05-23 19:39:11 +01:00
Mike McQuaid 4f75a77b08 Update deprecations
Add more deprecations, disable deprecations and remove disabled code.
2020-05-18 13:50:46 +01:00
Mike McQuaid af278b15de cli/parser: add formulae method.
This removes the coupling on args.formulae before it has been parsed.
2020-05-10 15:10:36 +01:00
Mike McQuaid c91f397605 cli: fix options handling.
Fix breaking options on taps again (second time in two weeks, sob).

To avoid doing this again: also add a test for this case (that I've
verified would have caught these cases).
2020-05-07 10:33:02 +01:00
Mike McQuaid 20a1199375 Refactor CLI to remove unless args_parsed
Refactor the CLI::Args module so it doesn't have different paths to
check arguments depending on whether the arguments have been parsed or
not. Instead, set the values we need from the global ARGV at
first, global initialisation time where they will be thrown away when
the actual arguments are parsed.

To do this some other general refactoring was needed:
- more methods made private when possible
- e.g. `HEAD?` used consistently instead of `head` before arguments
  are parsed.
- formula options are only parsed after named arguments are extracted
2020-05-05 17:47:51 +01:00
Mike McQuaid 9324a85955 cli: readability improvements.
- Rename `cmdline_args` to `argv` to make it more obvious where they
  come from.
- Make the `if args_parsed` early return into `unless args_parsed` to
  (hopefully) make it clearer that this is not the "normal" case and
  to not check `argv` unless arguments haven't been parsed.
2020-05-04 12:42:29 +01:00
Mike McQuaid 8d868b739c cli/args: simplify initialisation.
Move some logic from `CLI::Parser` to `CLI::Args` to simplify and make
more consistent the initialisation process.
2020-04-18 21:14:35 +01:00
Gautham G b05c72b98b cli/args: Make build_from_source public instance method 2020-04-12 19:12:16 +05:30
Mike McQuaid 3381cbf5c7 Use Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Dawid Dziurla 6c5109be7a cli/parser: chomp '=' from comma_array flag name 2020-03-16 15:02:43 +01:00
Mike McQuaid 1e265247ca rubocop: apply autofixes. 2020-03-13 21:16:18 +00:00
Mike McQuaid 66155ea370 cli/parser: add named/min_named helpers. 2020-03-05 09:25:14 +00:00
Mike McQuaid f13b0513ea cli/parser: avoid using remaining. 2020-03-04 17:27:01 +00:00
Mike McQuaid 8a9dcad2c7 Move more command handling logic to commands.rb. 2020-02-02 17:05:45 +01:00
Mike McQuaid eb87651341 Revert "Revert "help: print cli/parser help message if used"" 2020-02-02 16:36:59 +01:00
Gautham Goli acde828a45 ARGV: Replace ARGV.verbose? with Homebrew.args.verbose? 2020-02-02 14:00:04 +01:00
EricFromCanada aea6d79d21 option parser: check for extra named args 2019-12-15 00:04:45 -05:00
Gautham Goli 2b95755afe CLI::Args: Make processed_options read-only 2019-12-11 16:36:23 +05:30
Gautham Goli 28e62b52d1 cli_args: Remove cyclic dependency on ARGV 2019-12-11 16:36:23 +05:30
Gautham Goli 22e25dd593 argv: move formulae to cli/args 2019-12-11 16:36:23 +05:30
Gautham Goli d18b122272 cli_args: Fix options_only and flags_only 2019-09-22 20:28:43 +05:30
Mike McQuaidandGitHub 963cc556d4 Revert "argv: move options_only to cli/args" 2019-09-13 09:34:43 +01:00
Gautham Goli 4586632855 argv: move options_only to cli/args 2019-09-07 21:32:50 +05:30
EricFromCanada 2477773259 man: include global options with customized descriptions 2019-08-25 23:59:47 -04:00
Mike McQuaid 36dbad3922 Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid ae63381bd9 cli/parser: use cli/args and tweak freeze behaviour. 2019-04-17 22:16:58 +09:00
Mike McQuaid e40b171127 Rename cli_parser to cli/parser. 2019-04-17 22:16:50 +09:00