Last active
July 7, 2021 08:19
-
-
Save orikad/603ea97e33bb9e5ce07f55a36d53bdce to your computer and use it in GitHub Desktop.
Revisions
-
orikad revised this gist
Jun 7, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,10 +14,10 @@ then EDITOR=vim fi CC="gcc" set -o pipefail fname=$(basename "$1" | sed s/\\./\\\\./) path=$(echo "#include <$1>" | $CC -x c - -M | grep -o "/.*$fname") if [ ! -z "$path" ] -
orikad created this gist
Jan 30, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ #!/usr/bin/env bash if [ -z $1 ] then echo "Usage: $0 path/to/system/header.h" echo "Example: $0 fcntl.h" echo "Opens header in \$EDITOR ($EDITOR)" exit -1 fi if [ -z $EDITOR ] then echo "Warning: \$EDITOR is not set. Fallbacking to \`vim\`." EDITOR=vim fi CC="xcrun --run clang" set -o pipefail fname=$(basename "$1") path=$(echo "#include <$1>" | $CC -x c - -M | grep -o "/.*$fname") if [ ! -z "$path" ] then echo "$path" IFS=$'\n' for l in $path do $EDITOR "$l" done fi