From 93278dc7e362a932d01a16108d3431b6283ddcbb Mon Sep 17 00:00:00 2001 From: David Adam Date: Wed, 19 Jun 2013 23:59:13 +0800 Subject: [PATCH 1/4] docs: configure/Makefile changes to require at least Doxygen 1.5 --- Makefile.in | 21 +++++++++++++++++---- configure.ac | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index c59ac0de3..9db4aa47d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -76,6 +76,11 @@ LDFLAGS_MIMEDB = ${LDFLAGS} @LIBS_MIMEDB@ HAVE_GETTEXT=@HAVE_GETTEXT@ +# +# Set to 1 if we have doxygen +# + +HAVE_DOXYGEN=@HAVE_DOXYGEN@ # #Additional .cpp files used by common.o. These also have a corresponding @@ -258,12 +263,21 @@ MANUALS := $(addsuffix .1, $(addprefix share/man/man1/, \ TRANSLATIONS_SRC := $(wildcard po/*.po) TRANSLATIONS := $(TRANSLATIONS_SRC:.po=.gmo) +# +# If Doxygen is not available, don't attempt to build the documentation +# + +ifeq ($(HAVE_DOXYGEN), 1) + user_doc=user_doc +else + user_doc= +endif # # Make everything needed for installing fish # -all: $(PROGRAMS) user_doc share/man $(TRANSLATIONS) +all: $(PROGRAMS) $(user_doc) share/man $(TRANSLATIONS) @echo fish has now been built. @echo Use \'$(MAKE) install\' to install fish. .PHONY: all @@ -297,10 +311,9 @@ prof: all # Depend on the sources (*.hdr.in) and manually make the # intermediate *.hdr and doc.h files if needed -# Allow doxygen to fail, e.g. if it does not exist user_doc: $(HDR_FILES_SRC) Doxyfile.user user_doc.head.html $(HELP_SRC) doc.h $(HDR_FILES) - - (cat Doxyfile.user ; echo PROJECT_NUMBER=@PACKAGE_VERSION@) | doxygen - && touch user_doc + (cat Doxyfile.user ; echo PROJECT_NUMBER=@PACKAGE_VERSION@) | doxygen - && touch user_doc # @@ -839,7 +852,7 @@ clean: rm -f fish-@PACKAGE_VERSION@.tar rm -f fish-@PACKAGE_VERSION@.tar.gz rm -f fish-@PACKAGE_VERSION@.tar.bz2 - if command -v doxygen; then \ + if test $(HAVE_DOXYGEN) = 1; then \ rm -rf doc user_doc share/man; \ fi rm -rf fish-@PACKAGE_VERSION@ diff --git a/configure.ac b/configure.ac index 31675186f..185fc96b2 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,7 @@ conf_arg=$@ AC_SUBST(docdir) AC_SUBST(HAVE_GETTEXT) +AC_SUBST(HAVE_DOXYGEN) AC_SUBST(LDFLAGS_FISH) AC_SUBST(LIBS_FISH) AC_SUBST(LIBS_FISH_INDENT) @@ -184,6 +185,47 @@ AS_IF([test x$local_gettext != xno], ], ) +# +# Build/clean the documentation only if Doxygen is available +# + +doxygen_minimum=1.5 + +AC_ARG_WITH( + doxygen, + AS_HELP_STRING( + [--with-doxygen], + [use Doxygen to regenerate documentation] + ), + [use_doxygen=$withval], + [use_doxygen=auto] +) + +AS_IF([test "$use_doxygen" != "no"], + [ + AC_CHECK_PROGS([found_doxygen], [doxygen], [no]) + if test "$found_doxygen" != no; then + # test version + AC_MSG_CHECKING([the doxygen version]) + doxygen_version=`doxygen --version 2>/dev/null` + AC_MSG_RESULT([$doxygen_version]) + AS_VERSION_COMPARE([$doxygen_version], [$doxygen_minimum], + [ if test "$use_doxygen" = auto; then + AC_MSG_WARN([doxygen version $doxygen_version found, but $doxygen_minimum required]) + HAVE_DOXYGEN=0 + else + AC_MSG_FAILURE([doxygen version $doxygen_version found, but $doxygen_minimum required]) + fi + ], + [HAVE_DOXYGEN=1], [HAVE_DOXYGEN=1]) + elif test "$use_doxygen" != auto; then + AC_MSG_FAILURE([--with-doxygen was given, but the doxygen program could not be found]) + else + HAVE_DOXYGEN=0 + fi + ], +) + # # Try to enable large file support. This will make sure that on systems # where off_t can be either 32 or 64 bit, the latter size is used. On From 0b8f7d4fe7dfe749431200f4dcf44342262e5e49 Mon Sep 17 00:00:00 2001 From: David Celis Date: Tue, 11 Jun 2013 13:12:45 -0700 Subject: [PATCH 2/4] Add completion for Bundler Signed-off-by: David Celis --- share/completions/bundle.fish | 137 ++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 share/completions/bundle.fish diff --git a/share/completions/bundle.fish b/share/completions/bundle.fish new file mode 100644 index 000000000..032ace6ad --- /dev/null +++ b/share/completions/bundle.fish @@ -0,0 +1,137 @@ +# Completion for bundler + +function __fish_bundle_no_command --description 'Test if bundle has been given no subcommand' + set cmd (commandline -opc) + if [ (count $cmd) -eq 1 -a $cmd[1] = 'bundle' ] + return 0 + end + return 1 +end + +function __fish_bundle_using_command --description 'Test if bundle has been given a specific subcommand' + set cmd (commandline -opc) + if [ (count $cmd) -gt 1 ] + if [ $argv[1] = $cmd[2] ] + return 0 + end + end + return 1 +end + +function __fish_bundled_gems + bundle list | sed '1 d' | sed -e 's/\*//g' -e 's/(.*)//g' -e 's/^ *//g' -e 's/ *$//g' +end + +# Options for all commands +complete -c bundle -l no-color --description 'Prints all output without color' +complete -c bundle -s V -l verbose --description 'Prints out additional logging information' + +# No command +complete -f -n '__fish_bundle_no_command' -c bundle -l help --description 'Display a help page' +complete -c bundle -s v -l version --description 'Prints version information' + +## +# Primary Commands +## + +# Install +complete -f -n '__fish_bundle_no_command' -c bundle -a 'install' --description 'Install the gems specified by the Gemfile or Gemfile.lock' +complete -f -n '__fish_bundle_using_command install' -c bundle -l gemfile --description 'The location of the Gemfile bundler should use.' +complete -f -n '__fish_bundle_using_command install' -c bundle -l path --description 'The location to install the gems in the bundle to.' +complete -f -n '__fish_bundle_using_command install' -c bundle -l system --description 'Installs the gems in the bundle to the system location.' +complete -f -n '__fish_bundle_using_command install' -c bundle -l without --description 'A space-separated list of groups to skip installing.' +complete -f -n '__fish_bundle_using_command install' -c bundle -l local --description 'Use cached gems instead of connecting to rubygems.org.' +complete -f -n '__fish_bundle_using_command install' -c bundle -l deployment --description "Switches bundler's defaults into deployment mode." +complete -f -n '__fish_bundle_using_command install' -c bundle -l binstubs --description 'Create a directory containing executabes that run in the context of the bundle.' +complete -f -n '__fish_bundle_using_command install' -c bundle -l shebang --description 'Specify a ruby executable to use with generated binstubs.' +complete -f -n '__fish_bundle_using_command install' -c bundle -l standalone --description 'Make a bundle that can work without RubyGems or Bundler at run-time.' +complete -f -n '__fish_bundle_using_command install' -c bundle -l trust-policy --description 'Apply a RubyGems security policy: {High,Medium,Low,No}Security' +complete -f -n '__fish_bundle_using_command install' -c bundle -l no-cache --description 'Do not update the cache in vendor/cache with the newly bundled gems.' +complete -f -n '__fish_bundle_using_command install' -c bundle -l quiet --description 'Do not print progress information to stdout.' + +# Update +complete -f -n '__fish_bundle_no_command' -c bundle -a 'update' --description 'Update dependencies to their latest versions' +complete -f -n '__fish_bundle_using_command update' -c bundle -l source --description 'The name of a :git or :path source used in the Gemfile.' +complete -f -n '__fish_bundle_using_command update' -c bundle -a '(__fish_bundled_gems)' + +# Package +complete -f -n '__fish_bundle_no_command' -c bundle -a 'package' --description 'Package the .gem files required by your application into the vendor/cache directory' + +# Exec +complete -f -n '__fish_bundle_no_command' -c bundle -a 'exec' --description 'Execute a script in the context of the current bundle' + +# Help +complete -f -n '__fish_bundle_no_command' -c bundle -a 'help' --description 'Describe available tasks or one specific task' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'install' --description 'Install the gems specified by the Gemfile or Gemfile.lock' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'update' --description 'Update dependencies to their latest versions' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'package' --description 'Package .gem files into the vendor/cache directory' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'exec' --description 'Execute a script in the context of the current bundle' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'check' --description 'Check bundler requirements for your application' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'list' --description 'Show all of the gems in the current bundle' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'show' --description 'Show the source location of a particular gem in the bundle' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'outdated' --description 'Show all of the outdated gems in the current bundle' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'console' --description 'Start an IRB session in the context of the current bundle' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'open' --description 'Open an installed gem in your $EDITOR' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'viz' --description 'Generate a visual representation of your dependencies' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'init' --description 'Generate a simple Gemfile' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'gem' --description 'Create a simple gem, suitable for development with bundler' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'platform' --description 'Displays platform compatibility information' +complete -f -n '__fish_bundle_using_command help' -c bundle -a 'cleanup' --description 'Cleans up unused gems in your bundler directory' + +## +# Utilities +## + +# Check +complete -f -n '__fish_bundle_no_command' -c bundle -a 'check' --description 'Determine whether the requirements for your application are installed and available to bundler' +complete -f -n '__fish_bundle_using_command check' -c bundle -l gemfile --description 'The location of the Gemfile bundler should use.' +complete -f -n '__fish_bundle_using_command check' -c bundle -l path --description 'Specify a path other than the system default (BUNDLE_PATH or GEM_HOME).' +complete -f -n '__fish_bundle_using_command check' -c bundle -l dry-run --description 'Lock the Gemfile' + +# List +complete -f -n '__fish_bundle_no_command' -c bundle -a 'list' --description 'Show all of the gems in the current bundle' +complete -f -n '__fish_bundle_using_command list' -c bundle -l paths --description 'List the paths of all gems required by your Gemfile' + +# Show +complete -f -n '__fish_bundle_no_command' -c bundle -a 'show' --description 'Show the source location of a particular gem in the bundle' +complete -f -n '__fish_bundle_using_command show' -c bundle -a '(__fish_bundled_gems)' + +# Outdated +complete -f -n '__fish_bundle_no_command' -c bundle -a 'outdated' --description 'Show all of the outdated gems in the current bundle' +complete -f -n '__fish_bundle_using_command outdated' -c bundle -l pre --description 'Check for newer pre-release gems' +complete -f -n '__fish_bundle_using_command outdated' -c bundle -l source --description 'Check against a specific source' +complete -f -n '__fish_bundle_using_command outdated' -c bundle -l local --description 'Use cached gems instead of attempting to fetch gems remotely' +complete -f -n '__fish_bundle_using_command outdated' -c bundle -a '(__fish_bundled_gems)' + +# Console +complete -f -n '__fish_bundle_no_command' -c bundle -a 'console' --description 'Start an IRB session in the context of the current bundle' + +# Open +complete -f -n '__fish_bundle_no_command' -c bundle -a 'open' --description 'Open an installed gem in your $EDITOR' +complete -f -n '__fish_bundle_using_command open' -c bundle -a '(__fish_bundled_gems)' + +# Viz +complete -f -n '__fish_bundle_no_command' -c bundle -a 'viz' --description 'Generate a visual representation of your dependencies' +complete -f -n '__fish_bundle_using_command viz' -c bundle -s f -l file --description 'The name to use for the generated file (see format option)' +complete -f -n '__fish_bundle_using_command viz' -c bundle -s v -l version --description 'Show each gem version' +complete -f -n '__fish_bundle_using_command viz' -c bundle -s r -l requirements --description 'Show the version of each required dependency' +complete -f -n '__fish_bundle_using_command viz' -c bundle -s F -l format --description 'Output a specific format (png, jpg, svg, dot, ...)' + +# Init +complete -f -n '__fish_bundle_no_command' -c bundle -a 'init' --description 'Generate a simple Gemfile, placed in the current directory' +complete -f -n '__fish_bundle_using_command init' -c bundle -l gemspec --description 'Use a specified .gemspec to create the Gemfile' + +# Gem +complete -f -n '__fish_bundle_no_command' -c bundle -a 'gem' --description 'Create a simple gem, suitable for development with bundler' +complete -f -n '__fish_bundle_using_command gem' -c bundle -s b -l bin --description 'Generate a binary for your library' +complete -f -n '__fish_bundle_using_command gem' -c bundle -s t -l test --description 'Generate a test directory for your library (rspec or minitest)' +complete -f -n '__fish_bundle_using_command gem' -c bundle -s e -l edit --description 'Path to your editor' + +# Platform +complete -f -n '__fish_bundle_no_command' -c bundle -a 'platform' --description 'Displays platform compatibility information' +complete -f -n '__fish_bundle_using_command platform' -c bundle -l ruby --description 'Only display Ruby directive information' + +# Clean +complete -f -n '__fish_bundle_no_command' -c bundle -a 'clean' --description 'Cleans up unused gems in your bundler directory' +complete -f -n '__fish_bundle_using_command clean' -c bundle -l dry-run --description 'Only print out changes, do not actually clean gems' +complete -f -n '__fish_bundle_using_command clean' -c bundle -l force --description 'Forces clean even if --path is not set' From 7e7b50cd74afb5623cb38f52266f4484b38a969d Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Sat, 22 Jun 2013 17:15:43 +0200 Subject: [PATCH 3/4] Put user paths at beginning --- share/config.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/config.fish b/share/config.fish index 553aab5d3..056fd34f7 100644 --- a/share/config.fish +++ b/share/config.fish @@ -69,9 +69,9 @@ function __fish_reconstruct_path -d "Update PATH when fish_user_paths changes" - end set -e __fish_added_user_paths - for x in $fish_user_paths + for x in $fish_user_paths[-1..1] if not contains $x $local_path - set local_path $local_path $x + set local_path $x $local_path set -g __fish_added_user_paths $__fish_added_user_paths $x end end From 07b7a65b8691028e4cd8b25ec91629da6718fb5a Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Sat, 22 Jun 2013 17:22:05 +0200 Subject: [PATCH 4/4] Update documentation for $fish_user_paths --- doc_src/index.hdr.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc_src/index.hdr.in b/doc_src/index.hdr.in index 762b8193e..9b674479d 100644 --- a/doc_src/index.hdr.in +++ b/doc_src/index.hdr.in @@ -973,7 +973,7 @@ certain environment variables. - A large number of variable starting with the prefixes \c fish_color and \c fish_pager_color. See Variables for changing highlighting colors for more information. - \c fish_greeting, the greeting message printed on startup. - \c LANG, \c LC_ALL, \c LC_COLLATE, \c LC_CTYPE, \c LC_MESSAGES, \c LC_MONETARY, \c LC_NUMERIC and \c LC_TIME set the language option for the shell and subprograms. See the section Locale variables for more information. -- \c fish_user_paths, an array of directories that are appended to PATH. This can be a universal variable. +- \c fish_user_paths, an array of directories that are prepended to PATH. This can be a universal variable. - \c PATH, an array of directories in which to search for commands - \c umask, the current file creation mask. The preferred way to change the umask variable is through the umask function. An attempt to set umask to an invalid value will always fail.