From: Kazuhiro NISHIYAMA Date: 2010-12-12T21:29:30+09:00 Subject: [ruby-dev:42755] [Ruby 1.9-Bug#4152] optparseのzsh compsysでrspecの補完が出来ない チケット #4152 が更新されました。 (by Kazuhiro NISHIYAMA) [p] などを \[p\] のようにエスケープすれば良いようです。 % cat ~/.zsh.d/Completion/_rspec-trunk #compdef rspec-trunk typeset -A opt_args local context state line _arguments -s -S \ "-b[Enable full backtrace]" \ "--backtrace[Enable full backtrace]" \ "-c[Enable color in the output]" \ "--color[Enable color in the output]" \ "--no-color[Enable color in the output]" \ "--colour[Enable color in the output]" \ "--no-colour[Enable color in the output]" \ "-d[Enable debugging]" \ "--debug[Enable debugging]" \ "-e[Run examples whose full descriptions match this pattern(PATTERN is compiled into a Ruby regular expression)]" \ "--example[Run examples whose full descriptions match this pattern(PATTERN is compiled into a Ruby regular expression)]" \ "-f[Choose a formatter [p]rogress (default - dots) [d]ocumentation (group and example names) [h]tml [t]extmate custom formatter class name]" \ "--format[Choose a formatter [p]rogress (default - dots) [d]ocumentation (group and example names) [h]tml [t]extmate custom formatter class name]" \ "-o[output to a file instead of STDOUT]" \ "--out[output to a file instead of STDOUT]" \ "-I[specify $LOAD_PATH directory (may be used more than once)]" \ "-l[Specify the line number of a single example to run]" \ "--line_number[Specify the line number of a single example to run]" \ "-p[Enable profiling of examples with output of the top 10 slowest examples]" \ "--profile[Enable profiling of examples with output of the top 10 slowest examples]" \ "-r[Require a file]" \ "--require[Require a file]" \ "-v[Show version]" \ "--version[Show version]" \ "-X[Run examples via DRb]" \ "--drb[Run examples via DRb]" \ "--configure[Generate configuration files]" \ "--drb-port[Port to connect to on the DRb server]" \ "--tty[]" \ "--fail-fast[Use the fail_fast option to tell RSpec to abort the run on first failure.]" \ "-t[Run examples with the specified tagTo exclude examples, add ~ before the tag (e.g. ~slow)(TAG is always converted to a symbol)]" \ "--tag[Run examples with the specified tagTo exclude examples, add ~ before the tag (e.g. ~slow)(TAG is always converted to a symbol)]" \ "-h[You're looking at it.]" \ "--help[You're looking at it.]" \ '*:file:_files' && return 0 % vi ~/.zsh.d/Completion/_rspec-trunk [p] などを \[p\] のようにエスケープ % cat ~/.zsh.d/Completion/_rspec-trunk #compdef rspec-trunk typeset -A opt_args local context state line _arguments -s -S \ "-b[Enable full backtrace]" \ "--backtrace[Enable full backtrace]" \ "-c[Enable color in the output]" \ "--color[Enable color in the output]" \ "--no-color[Enable color in the output]" \ "--colour[Enable color in the output]" \ "--no-colour[Enable color in the output]" \ "-d[Enable debugging]" \ "--debug[Enable debugging]" \ "-e[Run examples whose full descriptions match this pattern(PATTERN is compiled into a Ruby regular expression)]" \ "--example[Run examples whose full descriptions match this pattern(PATTERN is compiled into a Ruby regular expression)]" \ "-f[Choose a formatter \[p\]rogress (default - dots) \[d\]ocumentation (group and example names) \[h\]tml \[t\]extmate custom formatter class name]" \ "--format[Choose a formatter \[p\]rogress (default - dots) \[d\]ocumentation (group and example names) \[h\]tml \[t\]extmate custom formatter class name]" \ "-o[output to a file instead of STDOUT]" \ "--out[output to a file instead of STDOUT]" \ "-I[specify $LOAD_PATH directory (may be used more than once)]" \ "-l[Specify the line number of a single example to run]" \ "--line_number[Specify the line number of a single example to run]" \ "-p[Enable profiling of examples with output of the top 10 slowest examples]" \ "--profile[Enable profiling of examples with output of the top 10 slowest examples]" \ "-r[Require a file]" \ "--require[Require a file]" \ "-v[Show version]" \ "--version[Show version]" \ "-X[Run examples via DRb]" \ "--drb[Run examples via DRb]" \ "--configure[Generate configuration files]" \ "--drb-port[Port to connect to on the DRb server]" \ "--tty[]" \ "--fail-fast[Use the fail_fast option to tell RSpec to abort the run on first failure.]" \ "-t[Run examples with the specified tagTo exclude examples, add ~ before the tag (e.g. ~slow)(TAG is always converted to a symbol)]" \ "--tag[Run examples with the specified tagTo exclude examples, add ~ before the tag (e.g. ~slow)(TAG is always converted to a symbol)]" \ "-h[You're looking at it.]" \ "--help[You're looking at it.]" \ '*:file:_files' && return 0 % unfunction _rspec-trunk % autoload -U _rspec-trunk % rspec-trunk -[TAB] option --backtrace -b -- Enable full backtrace --configure -- Generate configuration files --debug -d -- Enable debugging --drb -X -- Run examples via DRb --drb-port -- Port to connect to on the DRb server --example -e -- Run examples whose full descriptions --fail-fast -- Use the fail_fast option to tell RSpe --format -f -- Choose a formatter [p]rogress (defau --help -h -- You're looking at it. --line_number -l -- Specify the line number of a single e --no-color --colour --color -c --no-colour -- Enable color in the output --out -o -- output to a file instead of STDOUT --profile -p -- Enable profiling of examples with out --require -r -- Require a file --tag -t -- Run examples with the specified tagTo --tty -- --version -v -- Show version -I -- specify directory (may be used more ---------------------------------------- http://redmine.ruby-lang.org/issues/show/4152 ---------------------------------------- http://redmine.ruby-lang.org