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)
- Child command context is not updated when global context changed HOT 2
- [Bug] SetArgs doesn't reset flag value HOT 9
- A research for generating PR checklists in Pull Request Template
- shorthand not working and throw panic while use name works HOT 2
- Plugins: add map to store arbitrary data in `Command` HOT 1
- [doc] Add support for taking in `text/template`s for generating docs HOT 1
- docs: Content of user_guide.md not published at cobra.dev
- Add EnableFlagSorting similar to EnableCommandSorting
- non-boolean flags found on sub commands regardless of order HOT 4
- Fish completion fails due to `eval` and subshell execution during completion HOT 1
- Update ArgLenAt Dash to search for first option with single dash instead of only double dash
- PersistantFlags are lost when calling up PersistentPostRun chain HOT 1
- 'MarkFlagsRequiredTogether' does not work as intended. Am I wrong? HOT 1
- os.Args added as flags to command
- Accessing cobra command structure internally (porting applications which use cobra to android)
- Huge bash completions file that's very slow to source HOT 2
- Data race when using multiple unrelated `cobra.Command` instances HOT 1
- How do I use multiple characters in a short parameter? HOT 5
- Flag special "mark" support
- CheckErr with custom status code
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.