diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | builtin_jobs.cpp | 1 | ||||
-rw-r--r-- | doc_src/faq.hdr | 4 | ||||
-rw-r--r-- | doc_src/index.hdr.in | 6 | ||||
-rwxr-xr-x | share/tools/web_config/webconfig.py | 43 |
5 files changed, 34 insertions, 22 deletions
diff --git a/.travis.yml b/.travis.yml index e60be3a4..b7585453 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,3 +20,5 @@ notifications: - "%{repository}#%{build_number} (%{commit} on %{branch} by %{author}): %{message} Details at %{build_url}" use_notice: true skip_join: true +matrix: + fast_finish: true diff --git a/builtin_jobs.cpp b/builtin_jobs.cpp index c6ca7713..02bf94f2 100644 --- a/builtin_jobs.cpp +++ b/builtin_jobs.cpp @@ -343,6 +343,7 @@ static int builtin_jobs(parser_t &parser, wchar_t **argv) append_format(stdout_buffer, _(L"%ls: There are no jobs\n"), argv[0]); + return 1; } return 0; diff --git a/doc_src/faq.hdr b/doc_src/faq.hdr index 3961d1da..81bac7ae 100644 --- a/doc_src/faq.hdr +++ b/doc_src/faq.hdr @@ -226,8 +226,8 @@ fish_title function will not work. \section faq-greeting How do I change the greeting message? -Change the value of the variable fish_greeting. For example, to remove -the greeting use: +Change the value of the variable \c fish_greeting or create a \c fish_greeting +function. For example, to remove the greeting use: <pre> set fish_greeting diff --git a/doc_src/index.hdr.in b/doc_src/index.hdr.in index 9e67724a..cb24bcf0 100644 --- a/doc_src/index.hdr.in +++ b/doc_src/index.hdr.in @@ -1320,9 +1320,9 @@ end \subsection greeting Configurable greeting -If a function named fish_greeting exists after initialization, it will -be run when entering interactive mode. Otherwise,if an environment -variable named fish_greeting exists, it will be printed. +If a function named \c fish_greeting exists, it will be run when entering +interactive mode. Otherwise, if an environment variable named \c fish_greeting +exists, it will be printed. \subsection event Event handlers diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py index e5915ebd..fec78af9 100755 --- a/share/tools/web_config/webconfig.py +++ b/share/tools/web_config/webconfig.py @@ -29,6 +29,8 @@ try: except ImportError: import simplejson as json +from optparse import OptionParser + FISH_BIN_PATH = False # will be set later def run_fish_cmd(text): from subprocess import PIPE @@ -282,11 +284,10 @@ class BindingParser: "sleft": "Shift Left", "sright": "Shift Right" } - def set_buffer(self, buffer, is_key=False): + def set_buffer(self, buffer): """ Sets code to parse """ self.buffer = buffer - self.is_key = is_key self.index = 0 def get_char(self): @@ -356,12 +357,9 @@ class BindingParser: def get_readable_binding(self): """ Gets a readable representation of binding """ - if self.is_key: - try: - result = BindingParser.readable_keys[self.buffer] - except KeyError: - result = self.buffer.title() - else: + try: + result = BindingParser.readable_keys[self.buffer] + except KeyError: result = self.parse_binding() return result @@ -547,18 +545,29 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): bindings = [] binding_parser = BindingParser() + parser = OptionParser() + parser.add_option("-k") + parser.add_option("-M") + parser.add_option("-m") + + # Ignore any parsing errors + parser.error = lambda x: None + for line in out.split('\n'): - comps = line.split(' ', 2) - if len(comps) < 3: + comps = line.split(' ', 1) + + if len(comps) < 2: continue - if comps[1] == '-k': - key_name, command = comps[2].split(' ', 1) - binding_parser.set_buffer(key_name, True) - fish_binding = FishBinding(command=command, binding=key_name, readable_binding=binding_parser.get_readable_binding()) - else: - binding_parser.set_buffer(comps[1]) - fish_binding = FishBinding(command=comps[2], binding=comps[1], readable_binding=binding_parser.get_readable_binding()) + # parse arguments passed to bind command + bind_args_list = comps[1].split(' ', 6) + (options, args) = parser.parse_args(bind_args_list) + + key_name= options.k + command = args[0] + + binding_parser.set_buffer(key_name) + fish_binding = FishBinding(command=command, binding=key_name, readable_binding=binding_parser.get_readable_binding()) bindings.append(fish_binding) return [ binding.get_json_obj() for binding in bindings ] |