question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

-D invalid option on bash 4.2 on OSX

See original GitHub issue

Perhaps I’m not understanding how to use this but I tried add

source /usr/local/etc/bash_completion.d/python-argcomplete.sh

into my ~/.bash_profile

But when I start a new shell I get:

bash: complete: -D: invalid option
complete: usage: complete [-abcdefgjksuv] [-pr] [-o option] [-A action] [-G globpat] [-W wordlist] [-P prefix] [-S suffix] [-X filterpat] [-F function] [-C command] [name ...]

My system:

peterbe@mpb:~$ bash --version
GNU bash, version 4.2.45(2)-release (i386-apple-darwin13.0.0)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

11reactions
lrepolhocommented, Jan 3, 2018

If someone ends up here like I did, this fixes the issue:

sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'
chsh -s /usr/local/bin/bash

As mentioned here: https://github.com/mathiasbynens/dotfiles/issues/544#issuecomment-104935642

0reactions
jasonfharriscommented, Jun 29, 2014

Thanks for getting back to me. Can I make a plea for some documentation to cover this being front and centre in the install section? It is kind of not so nice that OSX users on an up to date system can’t basically have an off the shelf working version… Ie for myself, I thought I had obviously done something wrong in my configuration or there was something peculiar with my install. It was only towards the end that I realised that maybe things just generally don’t work for off the shelf Mavericks without futzing around with it, actually having to read the documentation etc.

Of course like most people my steps were I just skimmed forward, found the install step and ran those two steps. Found that there was an error with putting the script into the completions directory (Maybe a problem only for me or maybe a problem on all OSX systems?), sighed… then went and fixed that problem by specifying a dest directory, then had the -D problem, then started googling around for that quickly and then looking in the issues. Regrettably I didn’t find this a smooth process…

In the end I had to find this out via looking into the github issues. MacOSX is likely not an insignificant chunk of the platforms python developers… So a plea for others that come after me to document this a bit more…

But in any case thank you for putting the effort into what otherwise looks like a very useful tools!

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

"read: -i: invalid option" in shell on OSX - linux - Stack Overflow
As the error states, the version of bash shipped on MacOS doesn't support read -i . You have some options: Install a newer...
Read more >
Bash Reference Manual - GNU.org
Performs the various shell expansions (see Shell Expansions), breaking the expanded tokens into lists of filenames (see Filename Expansion) and ...
Read more >
setup.bash error on OSX - ROS Answers
I just reinstalled Groovy on OSX 10.8.4 using Homebrew. I moved my old ROS directory from /opt/ros to /opt/ros_old so this is a...
Read more >
bash: declare: -A: invalid option` error message at shell start
The /bin/bash that ships with macOS Catalina is really old (version 3.2.57) and does not support declare -A . Presumably you had been...
Read more >
How to unset an invalid environment variable in bash?
You can unset multiple variables with multiple -u options. So if we had multiple variables: bash-4.2$ env | grep odd odd.var2=200 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found