Comments (10)
In case anyone with mac stumble onto this issue, here is the fix:
apache/openwhisk#2924 (comment)
_get_comp_words_by_ref: command not found
It looks that for Mac users in addition of installing the bash-completion
brew install bash-completion
The user also have to configure bash-completion package in their ~/.bash_profile if they have one or in the ~/.profile
By adding the following
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
from cobra.
@eparis any tips?
from cobra.
_init_completion is supposed to be included either with bash or with the bash_completions package...
from cobra.
I guess we need to have it fail silently instead of letting users know they need bash-completions > version 1.90 (I think that's where it was added)
I wouldn't want a noisy failure in a script loaded at login....
from cobra.
http://anonscm.debian.org/cgit/bash-completion/bash-completion.git/tree/bash_completion#n669
from cobra.
I could probably switch to _get_comp_words_by_ref which seems to be even older...
_get_comp_words_by_ref: ver 1.2 was June 2010
_init_completion: ver 1.90 was Nov 2011
I'll take suggestions, but it seems to me like Nov 2011 should recent enough support...
from cobra.
In my case I was trying to get it running under zsh --- It runs fine in bash on my Ubuntu 14.10. I will close this as "my fault".
from cobra.
I haven't looked at zsh, but it might be relatively easy to support, dunno.....
from cobra.
this also causes problems under Mac OS using brew
. The default bash-completion version you get with brew
is too old.
Installing the newer version is a no-go for some since it requires to switch to a newer bash version (4.x) but OS X only ships with 3.x.
why not support the older bash-completion? what's the drawback?
~ > bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin14)
Copyright (C) 2007 Free Software Foundation, Inc.
~ > brew info bash-completion
bash-completion: stable 1.3 (bottled)
Programmable bash completion
https://bash-completion.alioth.debian.org/
~ > system_profiler SPSoftwareDataType
Software:
System Software Overview:
System Version: OS X 10.10.4 (14E46)
Kernel Version: Darwin 14.4.0
from cobra.
The only 'drawback' is that I don't have a Mac and don't use 5 year out of date bash-completion. So I don't know how to do it. _init_completion (and in turn __get_comp_words_by_ref) are incredibly complex functions I can't truly understand and so I will not copy them wholesale into our codebase (as then we have to maintain them, and I'm just not up to the task)
If someone writes a 'simple' patch which adds compatibility further back, I'd be REALLY happy to take it. (where simple means I can understand it). I have no idea what is or isn't possible on a mac. Maybe it has _comp_words_by_ref and you can find a way to switch to that directly?
from cobra.
Related Issues (20)
- Nested searching with alias name HOT 9
- Is it possible to easily hide default flag values from help? HOT 5
- document using arg variables after cobra-cli init
- Arguments not passed to the help function
- Help command fails on flags HOT 2
- [Question] If I say exactly one parameter is required, how can I give a description so it it shows up if they --help HOT 2
- Need help with SetUsageTemplate() and Flags HOT 2
- Any way to have a "persistent" parameter that appears before the subcommand? HOT 4
- how to add entry to `Available Commands` help section. HOT 2
- How to distinguish default value and manually set value of a flag? HOT 2
- Root Command doesn't work with sub commands HOT 2
- Issues with flags marked as mutually exclusive during testing HOT 2
- The YAML docs gen description and synopsis fields are assigned to the wrong key
- Setting "Use" field in Command creation and then calling "Help" on Command object doesn't use the "Use" value HOT 5
- Weird behavior in terminal output. HOT 2
- Getting --help to print descriptions for arguments
- Recommended Pattern for Argument Pre-Processing?
- Cobra does not exit when help or version flag is passed HOT 1
- How does record executed commands and parameters HOT 1
- How does one mark a flag a dependency of another flag HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cobra.