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

Add completions for ninja build system #3415

Merged
merged 1 commit into from Oct 4, 2016
Merged

Add completions for ninja build system #3415

merged 1 commit into from Oct 4, 2016

Conversation

@bsott
Copy link
Contributor

bsott commented Sep 27, 2016

Description

https://ninja-build.org/

Tested on ubuntu 16.{04,10} & OS X 10.11

@@ -0,0 +1,5 @@
function __fish_print_ninja_targets
if [ -f build.ninja ]
ninja -t targets | sed 's/:.*//'

This comment has been minimized.

@faho

faho Sep 28, 2016 Member

What happens here when you call ninja without that file?

If it's just some error message, it's probably easier to suppress it so this can be used even if there's some other filename that ninja can use (now or in the future).

This comment has been minimized.

@faho

faho Sep 28, 2016 Member

Also, we try to use our string tool in our completions - string replace -r ':.*' ''.

This comment has been minimized.

@bsott

bsott Sep 28, 2016 Author Contributor

You mean something like

...
ninja -t targets | string replace -r ':.*' '' 2> /dev/null

?

This comment has been minimized.

@faho

faho Sep 28, 2016 Member

With the redirection after the ninja, not the string call. Otherwise yes.

@@ -0,0 +1,4 @@
function __fish_print_ninja_tools
echo list
ninja -t list | grep -v ':' | sed -Ee 's/[[:space:]]+([^[:space:]]+).*/\1/'

This comment has been minimized.

@faho

faho Sep 28, 2016 Member

As above, string is your friend here - string match -v ':' | string replace -r '\s+(\S+).*' '$1' (untested).

The "-E" option to sed is problematic as it's completely undocumented for GNU sed (though it appears to work).

This comment has been minimized.

@bsott

bsott Sep 28, 2016 Author Contributor

fixed, I've squashed it back to 1 commit

@faho faho added this to the fish 2.4.0 milestone Sep 28, 2016
@bsott bsott force-pushed the bsott:master branch 4 times, most recently from f3821b1 to a545cd2 Sep 28, 2016
@bsott bsott force-pushed the bsott:master branch from a545cd2 to ec52f1c Oct 3, 2016
@faho
faho approved these changes Oct 4, 2016
@faho faho merged commit 61388cf into fish-shell:master Oct 4, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@faho
Copy link
Member

faho commented Oct 4, 2016

Merged, thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.