Commit graph

397 commits

Author SHA1 Message Date
Kurtis Rader
277999adef implement argparse builtin
We've needed a fishy way to parse flags and arguments given to scripts
and functions for a very long time. In particular a manner that provides
the same behavior implemented by builtin commands. The long term goal is
to support DocOpt. But since it is unclear when that will happen so this
implements a `argparse` command. So named as homage to the excellent
Python module of the same name.

Fixes #4190
2017-07-12 22:38:24 -07:00
Charles Ferguson
3f129b570c Add test harness for fish command invocation, and tests for init command.
The new '-C' initial command needs some tests, and as there are no
tests just yet for the command invocation, this change adds a harness
and calls it from the high-level tests in the Makefile.

The tests are similar in style to the other high level tests, in that
we capture the output and compare it to that which we expect. The
harness itself is written in bash - sorry - because we're testing the
fish shell's invocation, and trying to do that with the fish we've
just built wouldn't actually make for a very useful test when things
go wrong.

The 'tests/invocation.sh' script can be executed manually, or as part
of the 'make test' target, to make it easy to use both as part of the
development and as part of automation.

The harness has only been tested on linux with bash 4.3.11, and requires
grep and sed. Although not tested with OS X, I believe I have avoided
the syntax which is inconsistent.

The tests added here cover just the initial command's basic execution,
and when it is mixed with the regular '-c' command.
2017-06-29 21:00:08 -07:00
Kurtis Rader
ffdabace5e more builtin style cleanup 2017-06-16 21:01:57 -07:00
Kurtis Rader
b480b117a9 split builtin realpath into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
b530d175e7 split builtin return into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
422b1bd066 split builtin bg into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
79e74d0ebb split builtin fg into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
070d204d9b split builtin pwd into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
a1744b5822 run make depend 2017-06-16 21:01:56 -07:00
Kurtis Rader
a6d6ded9a5 split builtin contains into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
bda6426bf7 split builtin builtin into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
551bd39889 split builtin command into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
fded427c6a split builtin cd into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
7840d53ecf split builtin source into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
52709e8051 split builtin disown into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
1d4a0fb091 split builtin echo into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
044f5512e2 split builtin function into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
1c91ec9dfa split builtin random into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
e7f87c08e1 split builtin status and read into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
ef8a0c93ea split builtin history into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
00ed221b5a split builtin functions into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
1b9824ae46 split builtin emit into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
b20ffca3e2 split builtin block into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
a6227f6c3a split builtin bind into its own module
As part of putting the `bind` command code into its own module refactor
how it parses its flags.
2017-06-16 21:01:56 -07:00
Kurtis Rader
3e29793d04 improve detection of msgs to be translated
This change does several things. First, it works around a quirk of the
`xgetttext` command that only recognizes description strings in even
numbered position on the command. Second, it allows descriptions
introduced by the `-d` short flag to be recognized.

More importantly, it normalizes the strings so that `xgettext` correctly
extracts them into the *.po file. Prior to this change many fish script
strings were ignored due to how they were written (e.g., single versus
double quotes).

Fixes #4073
2017-06-02 17:52:55 -07:00
Fabian Homborg
603c865129 Makefile.in: Fix "fish.config" typo
See #4073.
2017-05-27 11:05:29 +02:00
Kevin Ballard
ee6c23e6c2 Extract doc install into a separate target install-doc
This way people who install via Xcode can run `make install-doc` to get
the documentation pages, as Xcode doesn't include them.
2017-05-23 16:57:26 -07:00
Kevin Ballard
027667be53 Get rid of all the ||: stuff in the Makefile
Make has a built-in way of ignoring errors.
2017-05-23 16:57:24 -07:00
Kevin Ballard
36c2ecb64f Fix the ditto command in make xcode-install 2017-05-23 16:57:17 -07:00
Kurtis Rader
5604bb238e fix make test_high_level so it works 2017-04-25 21:18:14 -07:00
Kurtis Rader
6d02bec4c7 fix setting up and using the terminfo data
There should be just one place that calls `setupterm()`. While refactoring
the code I also decided to not make initializing the curses subsystem a
fatal error. We now try two fallback terminal names ("ansi" and "dumb")
and if those can't be used we still end up with a usable shell.

Fixes #3850
2017-03-08 20:54:37 -08:00
Georgy Yakovlev
b2174bc9c0 support the LINGUAS variable by make install
Fixes 3863
2017-02-22 19:58:06 -08:00
David Adam
41a49b014a Makefile: use recursively expanded variable for the list of manpages
Restores the installation of manual pages when running `make install`
without running `make` first, a bug introduced with 417255fc.

Closes #3813.
2017-02-05 14:22:16 +08:00
ridiculousfish
1875222e93 Use one invocation of $INSTALL instead of looping
Speed up our Makefile by using $INSTALL once per type of file,
rather than passing them individually.
2017-01-21 17:39:00 -08:00
mathbunnyru
9768653df7 New pcre2 2017-01-18 16:44:48 -08:00
mathbunnyru
7a80610300 Delete trailing spaces 2017-01-15 14:57:21 -08:00
David Adam
417255fc55 Makefile: skip the open manpage on OS X
This is normally handled by the build_documentation.sh script, but if
the tarball includes the documentation then that script is never run.

We should do it in both places as the Xcode build uses only the
build_documentation.sh script!

Fixes #2561.
2016-12-03 12:44:35 +08:00
ridiculousfish
9588c9a811 Teach make distclean to delete autom4te.cache aclocal.m4 2016-11-26 14:58:31 -08:00
ridiculousfish
38ea6e088e Don't invoke make in pcre directory unless it has a Makefile
make clean was outputting misleading messages due to our
recursive invocation of make in the pcre directory, even if
that directory has no Makefile. This can easily come about if
the ./configure script determines we have a system installed PCRE.

This change simply checks for the presence of the Makefile in
the PCRE directory before invoking recursive make, for the clean
and distclean targets.

Fixes #3586
2016-11-26 14:33:15 -08:00
ridiculousfish
c7a016a137 Enable C++11 in 'make lint'
autotools implements C++11 support by setting $CXX to
"g++ -std=c++11", so we have to make sure to quote $CXX when
passing it to the linter script
2016-11-26 12:59:00 -08:00
Aaron Gyes
93e6f57dfc Run make depend
Some object file dependencies have changed.
2016-11-20 20:38:52 -08:00
Aaron Gyes
1054a2fd36 Makefile.in: fix output alignment spacing 2016-11-20 14:38:02 -08:00
David Adam
1e234f492c Makefile: pass correct version macro
Fixes display of version in documentation header. A shell-style variable
instead of a Makefile-style variable left it displayed as
ISH_BUILD_VERSION.
2016-10-30 14:26:11 +08:00
Aaron Gyes
a8c9019a39 Re-fix 'fix lexicon_filter verbosity' 2016-10-22 18:37:11 -07:00
Kurtis Rader
100a0ea549 Revert "Fix lexicon_filter verbosity"
This reverts commit dcb39af8c0.

It breaks building the documentation because splitting the sed invocation
in the `lexicon_filter` target from the preceding `if` block means the
`WORDBL` and `WORDBR` shell vars aren't available.
2016-10-22 18:23:03 -07:00
Kurtis Rader
345950ac1b workaround broken groff man page config
Fixes #2673
2016-10-19 13:43:04 -07:00
Aaron Gyes
dcb39af8c0 Fix lexicon_filter verbosity
the `mv $@.tmp $@; test -x $@ || chmod a+x $@;` bit was printing out.
2016-10-17 18:48:47 -07:00
Aaron Gyes
632a209685 Don't show all the help input files on build
It's too much!
2016-10-03 14:35:14 -07:00
Aaron Gyes
98470ab608 Something got caught in my sed net: $(b) -> $(bo)
Oops. Fixes #3394
2016-09-20 12:04:46 -07:00
Aaron Gyes
8b1625be2b Fix "libraryn" typo 2016-09-19 17:18:43 -07:00