Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -1766,10 +1766,17 @@ ]) ]) ], [ AC_SUBST(RUN_TESTS, "run") ]) + +AC_ARG_WITH(fish_completions, + AS_HELP_STRING([--with-fish-completions], + [install completions for the fish shell])) +AS_IF([test x"$with_fish_completions" = x"yes"], [ + AC_SUBST(FISH_COMPLETIONS, fish) +]) dnl We don't call AC_PROG_CPP, but only AC_PROG_OBJCPP and set CPP to OBJCPP dnl and add OBJCPPFLAGS to CPPFLAGS, thus we need to AC_SUBST these ourself. AC_SUBST(CPP) AC_SUBST(CPPFLAGS) Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -30,10 +30,11 @@ ENCODINGS_SRCS = @ENCODINGS_SRCS@ EXCEPTIONS_A = @EXCEPTIONS_A@ EXCEPTIONS_EXCEPTIONS_A = @EXCEPTIONS_EXCEPTIONS_A@ EXCEPTIONS_EXCEPTIONS_LIB_A = @EXCEPTIONS_EXCEPTIONS_LIB_A@ EXCEPTIONS_LIB_A = @EXCEPTIONS_LIB_A@ +FISH_COMPLETIONS = @FISH_COMPLETIONS@ FORWARDING_A = @FORWARDING_A@ FORWARDING_FORWARDING_A = @FORWARDING_FORWARDING_A@ FORWARDING_FORWARDING_LIB_A = @FORWARDING_FORWARDING_LIB_A@ FORWARDING_LIB_A = @FORWARDING_LIB_A@ INSTANCE_M = @INSTANCE_M@ Index: utils/Makefile ================================================================== --- utils/Makefile +++ utils/Makefile @@ -1,11 +1,12 @@ include ../extra.mk SUBDIRS += ${OFARC} \ ${OFDNS} \ ${OFHASH} \ - ${OFHTTP} + ${OFHTTP} \ + completions include ../buildsys.mk DISTCLEAN = objfw-config ADDED utils/completions/Makefile Index: utils/completions/Makefile ================================================================== --- /dev/null +++ utils/completions/Makefile @@ -0,0 +1,5 @@ +include ../../extra.mk + +SUBDIRS = ${FISH_COMPLETIONS} + +include ../../buildsys.mk ADDED utils/completions/fish/Makefile Index: utils/completions/fish/Makefile ================================================================== --- /dev/null +++ utils/completions/fish/Makefile @@ -0,0 +1,9 @@ +DATA = objfw-compile.fish \ + objfw-config.fish \ + ofarc.fish \ + ofhash.fish \ + ofhttp.fish + +include ../../../buildsys.mk + +PACKAGE_NAME = fish/vendor_completions.d ADDED utils/completions/fish/objfw-compile.fish Index: utils/completions/fish/objfw-compile.fish ================================================================== --- /dev/null +++ utils/completions/fish/objfw-compile.fish @@ -0,0 +1,28 @@ +complete -c objfw-compile -s o -x -d 'Specify the output name (not file name!)' +complete -c objfw-compile -l arc -d 'Use automatic reference counting' +complete -c objfw-compile -l lib -x -d \ + 'Compile a library (with the specified version) instead of an application' +complete -c objfw-compile -l plugin \ + -d 'Compile a plugin instead of an application' +complete -c objfw-compile -l package -x -d 'Use the specified package' +complete -c objfw-compile -l builddir -r \ + -d 'Place built objects into the specified directory' +complete -c objfw-compile -s D -x -d 'Pass the specified define to the compiler' +complete -c objfw-compile -o framework -x \ + -d 'Pass the specified -framework argument to the linker (macOS / iOS only)' +# -f* cannot be represented. +complete -c objfw-compile -s F -x \ + -d 'Pass the specified -F flag to the linker (macOS / iOS only)' +# -g* cannot be represented. +complete -c objfw-compile -s I -x \ + -d 'Pass the specified -I flag to the compiler' +complete -c objfw-compile -s l -x -d 'Pass the specified -l flag to the linker' +complete -c objfw-compile -s L -x -d 'Pass the specified -L flag to the linker' +# -m* cannot be represented. +# -O* cannot be represented. +complete -c objfw-compile -o pthread \ + -d 'Pass -pthread to the compiler and linker' +# -std=* cannot be represented. +# -Wl,* cannot be represented. +# -W* cannot be represented. +complete -c objfw-compile -l help -d 'Show this help' ADDED utils/completions/fish/objfw-config.fish Index: utils/completions/fish/objfw-config.fish ================================================================== --- /dev/null +++ utils/completions/fish/objfw-config.fish @@ -0,0 +1,33 @@ +complete -c objfw-config -l all -d 'Outputs all flags + libs' +complete -c objfw-config -l arc -d 'Outputs the required OBJCFLAGS to use ARC' +complete -c objfw-config -l cflags -d 'Outputs the required CFLAGS' +complete -c objfw-config -l cppflags -d 'Outputs the required CPPFLAGS' +complete -c objfw-config -l cxxflags -d 'Outputs the required CXXFLAGS' +complete -c objfw-config -l framework-libs \ + -d 'Outputs the required LIBS, preferring frameworks' +complete -c objfw-config -l help -d 'Print help' +complete -c objfw-config -l ldflags -d 'Outputs the required LDFLAGS' +complete -c objfw-config -l libs -d 'Outputs the required LIBS' +complete -c objfw-config -l lib-cflags \ + -d 'Outputs CFLAGS for building a library' +complete -c objfw-config -l lib-ldflags \ + -d 'Outputs LDFLAGS for building a library' +complete -c objfw-config -l lib-prefix -d 'Outputs the prefix for libraries' +complete -c objfw-config -l lib-suffix -d 'Outputs the suffix for libraries' +complete -c objfw-config -l objc -d 'Outputs the OBJC used to compile ObjFW' +complete -c objfw-config -l objcflags -d 'Outputs the required OBJCFLAGS' +complete -c objfw-config -l package -x \ + -d 'Additionally outputs the flags for the specified package' +complete -c objfw-config -l packages-dir \ + -d 'Outputs the directory where flags for packages are stored' +complete -c objfw-config -l plugin-cflags \ + -d 'Outputs CFLAGS for building a plugin' +complete -c objfw-config -l plugin-ldflags \ + -d 'Outputs LDFLAGS for building a plugin' +complete -c objfw-config -l plugin-suffix -d 'Outputs the suffix for plugins' +complete -c objfw-config -l prog-suffix -d 'Outputs the suffix for binaries' +complete -c objfw-config -l reexport -d 'Outputs LDFLAGS to reexport ObjFW' +complete -c objfw-config -l rpath -d 'Outputs LDFLAGS for using rpath' +complete -c objfw-config -l static-libs \ + -d 'Outputs the required LIBS to link ObjFW statically' +complete -c objfw-config -l version -d 'Outputs the installed version' ADDED utils/completions/fish/ofarc.fish Index: utils/completions/fish/ofarc.fish ================================================================== --- /dev/null +++ utils/completions/fish/ofarc.fish @@ -0,0 +1,14 @@ +complete -c ofarc -s a -l append -d 'Append to archive' +complete -c ofarc -s c -l create -d 'Create archive' +complete -c ofarc -s C -l directory -r -d 'Extract into the specified directory' +complete -c ofarc -s E -l encoding -x \ + -d 'The encoding used by the archive (only tar files)' +complete -c ofarc -s f -l force -d 'Force / overwrite files' +complete -c ofarc -s h -l help -d 'Show help' +complete -c ofarc -s l -l list -d 'List all files in the archive' +complete -c ofarc -s n -l no-clobber -d 'Never overwrite files' +complete -c ofarc -s p -l print -d 'Print one or more files from the archive' +complete -c ofarc -s q -l quiet -d 'Quiet mode (no output, except errors)' +complete -c ofarc -s t -l type -x -a 'gz lha tar tgz zip' -d 'Archive type' +complete -c ofarc -s v -l verbose -d 'Verbose output for file list' +complete -c ofarc -s x -l extract -d 'Extract files' ADDED utils/completions/fish/ofhash.fish Index: utils/completions/fish/ofhash.fish ================================================================== --- /dev/null +++ utils/completions/fish/ofhash.fish @@ -0,0 +1,7 @@ +complete -c ofhash --long-option md5 +complete -c ofhash --long-option ripemd160 +complete -c ofhash --long-option sha1 +complete -c ofhash --long-option sha224 +complete -c ofhash --long-option sha256 +complete -c ofhash --long-option sha384 +complete -c ofhash --long-option sha256 ADDED utils/completions/fish/ofhttp.fish Index: utils/completions/fish/ofhttp.fish ================================================================== --- /dev/null +++ utils/completions/fish/ofhttp.fish @@ -0,0 +1,14 @@ +complete -c ofhttp -s b -l body -r -d 'Specify the file to send as body' +complete -c ofhttp -s c -l continue -d 'Continue download of existing file' +complete -c ofhttp -s f -l force -d 'Force / overwrite existing file' +complete -c ofhttp -s h -l help -d 'Show help' +complete -c ofhttp -s H -l header -x -d 'Add a header (e.g. X-Foo:Bar)' +complete -c ofhttp -s m -l method -x -d 'Set the method of the HTTP request' +complete -c ofhttp -s o -l output -r -d 'Specify output file name' +complete -c ofhttp -s O -l detect-filename \ + -d 'Do a HEAD request to detect the file name' +complete -c ofhttp -s P -l proxy -x -d 'Specify SOCKS5 proxy' +complete -c ofhttp -s q -l quiet -d 'Quiet mode (no output, except errors)' +complete -c ofhttp -s v -l verbose -d 'Verbose mode (print headers)' +complete -c ofhttp -l insecure \ + -d 'Ignore TLS errors and allow insecure redirects' Index: utils/objfw-compile ================================================================== --- utils/objfw-compile +++ utils/objfw-compile @@ -65,11 +65,11 @@ -m* Pass the specified -m flag to the compiler -O* Pass the specified -O flag to the compiler -pthread Pass -pthread to the compiler and linker -std=* Pass the specified -std= flag to the compiler -Wl,* Pass the specified -Wl, flag to the linker - -W* Pass the specified -W flag to the compiler" + -W* Pass the specified -W flag to the compiler --help Show this help __EOF__ } CPPFLAGS="$CPPFLAGS $($OBJFW_CONFIG $packages --cppflags)"