Commit graph

74 commits

Author SHA1 Message Date
Claudia
e3c617b6f4 When handling errors or missing methods, the CLI now suggests updating
This helps cut trivial issues that would be easily fixable by doing `brew update && …`.
2014-12-12 19:50:19 +01:00
Roland Walker
a335d3b06d unify and recast "Cask name" & "title" as "token"
* "Canonical App Name" becomes "Simplified App Name"
* devscript `cask_namer` renamed to `generate_cask_token`
* doc file `CASK_NAMING_REFERENCE.md` renamed to `cask_token_reference.md`
* DSL uses `"#{token}"` for interpolation instead of `"#{title}"`
* documentation text
* backend code (variables, method, class names)
* error message text
* tests
* code comments
* Cask comments
* emphasize `tags :name`
* doc: use "vendor" consistently instead of "developer"
* doc: many man page argument descriptions were incorrect
* incidental clarifications

Many backend variables similar to `cask_name` or `cask` have
been standardized to `cask_token`, `token`, etc, resolving a long-
standing ambiguity in which variables named `cask` might contain
a Cask instance or a string token.

In many places the docs could be shortened from "Cask name" to
simply "token", which is desirable because we use the term "Cask"
in too many contexts.
2014-12-01 11:00:23 -05:00
Roland Walker
839ccb98d4 recast _checklinks verb as _checkurl
remove stray doc item missed in #6966
2014-10-28 12:12:10 -04:00
Roland Walker
3f5551788c Merge pull request #6966 from rolandwalker/checklinks_internal
recast `checklinks` as internal command `_checklinks`
2014-10-25 06:44:36 -04:00
Roland Walker
2370400207 chg checklinks to internal command _checklinks
* `checklinks` is a very simple implementation useful only for development purposes
* it has no test coverage, only one line of documentation
* users regularly experiment with it and break it, especially
 `brew cask checklinks` with no arguments, which tests all Tapped Casks
2014-10-24 09:49:35 -04:00
Roland Walker
03350791c6 be more explicit about which errors are rescued 2014-10-23 11:57:47 -04:00
Claudia
0fe558b927 User-friendly error messages for invalid options/arguments; fixes #5997
- Show a more user-friendly error message when dealing with an option whose (mandatory) argument is missing.

- Likewise, we show a more user-friendly error message when a given option is ambiguous. Examples:
    - Given `-f`, the parser successfully expands to `--fontdir`.

    - Given `-c`, we fail to expand because the parser can’t tell if the user means `--caskroom` or rather `--colorpickerdir`. This exception now results in a nicer error message.

- Some commands now result in a consistent error message when a required cask name is missing.
This affects all stable commands which require one or more cask names as arguments, i. e. `cat`, `create`, `edit`, `fetch`, `info`, `install`, `uninstall`, and `zap`.

- Up to now, the commands `cat`, `create`, `edit`, and `info` used to treat any unknown option as a cask name. This commit changes that behaviour to make it consistent to the rest of the commands (like `fetch`, `install`, `uninstall`, and `zap`), who have silently discarded any unknown option in the past, and continue to do so.
2014-10-05 18:32:33 +02:00
Roland Walker
ca8417bf0e support brew cask --version per USAGE.md
closes #6178
2014-09-16 10:04:47 -04:00
Roland Walker
00921dd513 functionality and docs for zap stanza
* `zap` was previously supported as a noop for forward-compatibility
* Also adds restrictions against relative paths in `uninstall :files`
* Also documents safety conventions for `uninstall :files`
2014-09-13 10:21:17 -04:00
Roland Walker
1b05d18a3b add support for internet_plugin artifact
closes #5909
2014-08-26 11:22:25 -04:00
Roland Walker
b758a151da Merge pull request #5025 from rolandwalker/add_internal_stanza
add internal command `_stanza`
2014-06-23 06:44:07 -04:00
Roland Walker
dffed9999a add internal command _stanza
to extract the compiled/interpolated values for a given stanza.
2014-06-21 16:23:53 -04:00
Roland Walker
29a6a1ec10 Extend subcommand dispatch to include full paths
Covering all cases
- external commands as executables
- external commands as Ruby libraries
- built-in command verbs

This is intended as a development aid.

A side benefit is that an external command can be constructed
to use a `run` method, rather than having to accomplish everything
at `require` time.
2014-06-21 14:51:57 -04:00
Roland Walker
785da0ca93 whitespace 2014-06-21 09:37:39 -04:00
Roland Walker
584f77b637 add blank line to NullCommand message 2014-06-21 09:37:39 -04:00
Roland Walker
b395df5428 refactor variable name max_command_len 2014-06-21 09:37:39 -04:00
Roland Walker
a0e061b2d6 add _help internal command 2014-06-21 09:37:39 -04:00
Roland Walker
204bbe8927 add _dump internal-use verb 2014-06-21 09:37:39 -04:00
Roland Walker
8163745d4a create "internal use" command verbs
- based on abstract class `Cask::CLI::InternalUseBase`
- interal-use class file names follow `internal_<verb>.rb`, but the "internal" is dropped for the CLI
- internal-use verbs start with underscore at CLI
- internal-use verbs are invisible in the usage document
2014-06-21 09:37:39 -04:00
Roland Walker
604aaad3de simplify lookup_command
by `zip`ping `commands` with `command_classes`
2014-06-21 09:37:39 -04:00
Roland Walker
5c6a87639b recast commands method using command_classes
no longer a need for hardcoding constants to remove (such as
`:ISSUES_URL`), because `command_classes` checks for a `run`
method.
2014-06-21 09:37:38 -04:00
Roland Walker
eb99afce83 recast help/usage with command_classes
invoking new `command_name` method from the base class when the
command verb string is needed
2014-06-21 09:37:38 -04:00
Roland Walker
5206d2bc2a add command_classes method 2014-06-21 09:37:38 -04:00
Roland Walker
7956854e41 use fetch on ALIASES with default 2014-06-20 15:06:29 -04:00
Roland Walker
5005ad67f9 hoist ALIASES to top of class
with addtl formatting/comments
2014-06-20 15:06:29 -04:00
Roland Walker
b7573b3838 create abstract Cask::CLI::Base
from which all commands inherit.  Add `visible` method
for future use.
2014-06-20 15:06:29 -04:00
Tony
d273bb3020 Minor formatting tweaks to CLI help output 2014-06-10 12:33:21 -04:00
Roland Walker
13f8a4d282 remove issues_url and nullcommand from help output
necessitated by Homebrew's switch to Ruby 2.x
Fixes #4728
Fixes #4726
2014-06-06 17:10:28 -04:00
Roland Walker
290d1ccb38 ChecksumMismatchError is ordinary exception
not a bug
2014-06-02 23:26:19 -04:00
Roland Walker
1b9df93e20 no need to catch CaskAlreadyInstalledError
separately; it is already descended from CaskError
2014-06-02 23:24:59 -04:00
Lincoln Lee
227ac512bc Add brew cask cat command mentioned in #4018 2014-05-05 22:46:28 +08:00
Paul Hinze
f54eaf7082 update all references to new caskroom org home
global replace of:
  'phinze/homebrew-cask' -> 'caskroom/homebrew-cask'
  'phinze/cask' -> 'caskroom/cask'
  'phinze/homebrew-testcasks' -> 'caskroom/homebrew-testcasks'

and various other specific places that needed updates

<3 the homebrew-cask community!
2014-05-03 10:29:17 -05:00
Lincoln Lee
5faa850690 Remove ISSUES_URL from cli commands
When user run `brew cask` it will list all commands out.
There is a blank help command call issues_url which caused by the newly
introduced constant from #2971
2014-04-27 17:49:01 +08:00
Roland Walker
400433be20 Adapt to homebrew's move of the tap directory
Closes #4035. Closes #4029. Closes #4026.
2014-04-26 09:42:16 -04:00
Võ Anh Duy
0fb893027d Redirect user to cask issues page, fixes #1251 2014-04-19 20:21:48 +07:00
Võ Anh Duy
33a97a1a5f CLI - Fetch
Add `fetch` command to cli like suggestion at the end of #2528
2014-02-26 00:44:22 +07:00
Roland Walker
22e24ea5c5 Merge pull request #3131 from rolandwalker/cmd_aliases
provide command aliases to match Homebrew
2014-02-25 12:29:22 -05:00
Roland Walker
4fcdab0583 provide command aliases to match Homebrew
fixes #2969
2014-02-24 08:15:52 -05:00
Roland Walker
55e9cfc39d make brew cask update synonym for brew update
for convenience/typo
2014-02-21 10:23:16 -05:00
Roland Walker
d6c8a6917d add command brew cask cleanup
plus new option --outdated
2014-02-08 14:40:53 -05:00
Roland Walker
ad31b17316 Merge pull request #2647 from jedahan/screensaver
initial screensaver work
2014-01-28 08:21:19 -08:00
Jonathan Dahan
ca61dfdd81 Add support for screensaver artifact 2014-01-28 10:17:50 -05:00
Roland Walker
216444849e Add copious debugging with --debug
- add new file "cask/utils.rb" analogous to "utils.rb" in Homebrew
- define odebug and odumpcask, analogs of ohai and friends, but
  which only give output when --debug is in effect
- move the debug setting from an instance variable in Cask::CLI
  to a method Cask.debug, defined in "lib/cask/options.rb", which
  was added in #2276. (Perhaps options.rb should be merged back
  into Cask::CLI).
- sprinkle odebug statements liberally throughout the codebase
- update tests
2014-01-28 10:15:43 -05:00
Roland Walker
43362e4b3e Support external commands beneath brew cask 2014-01-24 12:07:42 -05:00
Lincoln Lee
cc14ebdb55 Implement input_method artifact 2014-01-19 00:40:56 +08:00
Paul Hinze
ec85054cb2 Merge pull request #2342 from rolandwalker/doctor_command
add command "brew cask doctor"
2014-01-08 09:44:09 -08:00
Roland Walker
d120d3b1a8 add command "brew cask doctor"
pursuant to discussion in #2275
2014-01-06 11:50:17 -05:00
Stratos Moros
7136269198 implement binary artifact 2014-01-05 22:55:18 +02:00
Paul Hinze
e46b89c908 Merge pull request #2081 from leoj3n/services-support
[WIP] services support
2013-12-15 15:26:44 -06:00
Paul Hinze
fd82e97fa1 Merge pull request #2085 from pstadler/master
Handle CaskAlreadyInstalledError more graceful
2013-12-14 07:10:22 -08:00