Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TAB completion is not happy on OSX #1738

Closed
samoht opened this issue Sep 17, 2014 · 7 comments
Closed

TAB completion is not happy on OSX #1738

samoht opened this issue Sep 17, 2014 · 7 comments

Comments

@samoht
Copy link
Member

samoht commented Sep 17, 2014

Sometime I got some weird error messages when a TAB-complete the opam command-line (I'm on head).

 opam list<TAB> sed: 1: "/^\.SH COMMANDS$/,/^\.S ...": bad flag in substitute command: '}'

I think I've updated the autocomplete script recently to use the new ones, but maybe I did something wrong.

@AltGr
Copy link
Member

AltGr commented Sep 18, 2014

If you could find the OSX - sed syntax for

/^\.SH COMMANDS$/,/^\.SH/ { s#\\-#-#g; s#^\\fB\([^,= ]*\)\\fR.*#\1#p }

I'd be grateful. Maybe just a ; after the last p ? Don't think I used any gsed specifics (but I may be wrong)

@samoht
Copy link
Member Author

samoht commented Sep 18, 2014

On http://stackoverflow.com/questions/4904225/need-help-porting-a-sed-command-from-debian-to-osx

OS X sed doesn't like multiple commands run together using semicolons or grouped in curly braces. If you have a sed script that consists of multiple commands, you'll have to break them up using -e

@AltGr
Copy link
Member

AltGr commented Sep 18, 2014

(source here and here)

@AltGr
Copy link
Member

AltGr commented Sep 18, 2014

graaah

Of course the best solution would be to have cmdliner output this directly :)

Maybe this could do the trick:

sed -e '/^\.SH COMMANDS$/,/^\.SH/ s#^\\fB\([^,= ]*\)\\fR.*#\1#p' -e 's#\\-#-#g'

@samoht
Copy link
Member Author

samoht commented Sep 18, 2014

For completion, @AltGr found the magic runes:

opam config --help=groff 2>/dev/null | sed -n -e 's%\\-%-%g' -e '/^\.SH COMMANDS$/,/^\.SH/ s%^\\fB\([^,= ]*\)\\fR.*%\1%p'

@AltGr
Copy link
Member

AltGr commented Sep 18, 2014

#1739

@samoht
Copy link
Member Author

samoht commented Sep 18, 2014

If you have an idea on how to handle that properly in cmdliner, I'm sure you are aware of dbuenzli/cmdliner#1 :p

@AltGr AltGr closed this as completed Sep 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants