This repository has been archived by the owner. It is now read-only.

Command Options/Args DSL #11041

Closed
mxcl opened this Issue Mar 19, 2012 · 6 comments

Comments

Projects
None yet
6 participants
@mxcl
Member

mxcl commented Mar 19, 2012

This is just a design document for now.

module Homebrew extend self
  operates_on_one :formula
  option :f, :force
  option :i, :interactive
  option :d, :debug
  option :v, :verbose
  option :n, "ignore-dependencies"
  option :F, "fresh"
  option_with_arg :c, "cc"
  option_with_arg :t, "source", [:stable, :bottle, :devel, :HEAD]

  deprecated_option "--build-from-source" => "source=stable"
  deprecated_option "devel" => "source=unstable"
  deprecated_option "HEAD" => "source=HEAD"
  deprecated_option "use-clang" => "cc=clang"
  deprecated_option "use-llvm" => "cc=clang"
  deprecated_option "use-gcc" => "cc=gcc"

  def install

So the command line option parser component can error out for invalid options. Obviously in the case of install it would also need to parse the Formula's options.

@jacknagel

This comment has been minimized.

Show comment Hide comment
@jacknagel

jacknagel Mar 22, 2012

Contributor

Like the look of it. Could then generate --help output on a per-command basis, too.

Contributor

jacknagel commented Mar 22, 2012

Like the look of it. Could then generate --help output on a per-command basis, too.

@adamv

This comment has been minimized.

Show comment Hide comment
@adamv

adamv Apr 17, 2013

Contributor

What do we think about this? Close the issue and add to the brew2 wiki (which may not actually exist yet?)

Contributor

adamv commented Apr 17, 2013

What do we think about this? Close the issue and add to the brew2 wiki (which may not actually exist yet?)

@MikeMcQuaid

This comment has been minimized.

Show comment Hide comment
@MikeMcQuaid

MikeMcQuaid Apr 17, 2013

Owner

Yeh, I like the idea (and having a brew2 wiki).

Owner

MikeMcQuaid commented Apr 17, 2013

Yeh, I like the idea (and having a brew2 wiki).

@adamv

This comment has been minimized.

Show comment Hide comment
@adamv

adamv Nov 17, 2013

Contributor

Created a "Homebrew 2" page in the Wiki and added a link to this issue.

Contributor

adamv commented Nov 17, 2013

Created a "Homebrew 2" page in the Wiki and added a link to this issue.

@adamv adamv closed this Nov 17, 2013

@hanxue

This comment has been minimized.

Show comment Hide comment
@hanxue

hanxue Apr 25, 2014

Contributor

Sorry, I jumped in late. Looks a bit like a circular link: this Issue mention "Homebrew 2" page, and the "Homebrew 2" page is empty except for a link to this issue.

Is there anyway I can add the comments here to the page?

Contributor

hanxue commented Apr 25, 2014

Sorry, I jumped in late. Looks a bit like a circular link: this Issue mention "Homebrew 2" page, and the "Homebrew 2" page is empty except for a link to this issue.

Is there anyway I can add the comments here to the page?

@bfontaine

This comment has been minimized.

Show comment Hide comment
@bfontaine

bfontaine Jan 4, 2015

Member

Another upside of a more formal options definition would be the auto-generation of {Bash,Zsh,Fish} completion files, like what sferik/t does.

Member

bfontaine commented Jan 4, 2015

Another upside of a more formal options definition would be the auto-generation of {Bash,Zsh,Fish} completion files, like what sferik/t does.

@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.