aboutsummaryrefslogtreecommitdiffhomepage
path: root/builtin_set.cpp
Commit message (Collapse)AuthorAge
* Update various strings for translation, avoid _ for non-translationsGravatar David Adam2014-11-25
| | | | | Use __ instead of _ as a placeholder for ignored variables in `read` statements.
* set: warn on setting a universal variable when a global is activeGravatar David Adam2014-10-06
| | | | Closes #806.
* set: Print an error when setting `umask` to a bad valueGravatar Kevin Ballard2014-08-21
| | | | | | | | | Repurpose the ENV_INVALID return value for env_set(), which wasn't currently used by anything. When a bad value is passed for the 'umask' key, return ENV_INVALID to signal this and print a good error message from the `set` builtin. This makes `set umask foo` properly produce an error.
* Change how we separate toplevel and global scopesGravatar Kevin Ballard2014-07-13
| | | | | | | | | | | | Instead of introducing a new local scope at the point of `set`, merely push a new local scope at the end of env_init(). This means we have a single toplevel local scope across the lifetime of the fish process, which means that set -l foo bar echo $foo behaves as expected, without modifying the global environment.
* set: Don't create empty var when erasing indexGravatar Kevin Ballard2014-07-12
| | | | | When using `set -e foo[1]` to erase an index, if the variable doesn't already exist, return 1 instead of creating it as an empty variable.
* Add an optional mode to env_get_string()Gravatar Kevin Ballard2014-07-12
| | | | | | | | The mode restricts the scope in which the variable is searched for. Use this new restricted scope functionality in the `set` builtin. This fixes `set -g` to not show local shadowing variable values, and also allows for scoped erasing of slices.
* set: Print an error when setting a special var in the wrong scopeGravatar Kevin Ballard2014-07-12
| | | | | | | | | When attempting to set a readonly or electric variable in the local or universal scopes, print an appropriate error. Similarly, print an error when setting an electric variable as exported. In most cases this is simply a nicer error instead of the 'read-only' one, but for the 'umask' variable it prevents `set -l umask 0023` from silently changing the global value.
* set: Don't treat toplevel scope the same as globalGravatar Kevin Ballard2014-07-12
| | | | | | | | | | | When using the `set` command with the -l flag, if we're at the top level, create a temporary local scope. This makes query/assignment behavior be consistent with the value-printing behavior. This works by marking the current block as needing to pop the environment if a local scope was pushed. I assume this is safe to do. I also assume the current block is the right one to modify, rather than trying to walk up the stack to the root.
* Fix typo and tweak `set` docsGravatar Kevin Ballard2014-07-12
| | | | Move the docs for the `-n` flag to `set` out of the list of scopes.
* Remove connection_t usage from write_to_fdGravatar ridiculousfish2014-06-09
|
* Update style and formatting to conform to fish style guide.Gravatar ridiculousfish2014-01-15
|
* Miscellaneous minor fixes based on cppcheck static analyzerGravatar ridiculousfish2014-01-12
|
* Remove unused values in builtin_set.Gravatar Konrad Borowski2013-10-17
|
* print_variables should use ellipsis_char instead of literal ellipsisGravatar ridiculousfish2013-04-19
|
* Large set of changes to how PATH is handled. Changed fish to no longer ↵Gravatar ridiculousfish2013-02-19
| | | | | | modify PATH in share/config.fish. Introduced variable fish_user_paths, and a glue function __fish_reconstruct_path that splices together PATH with fish_user_paths. Changed fish to no longer validate changes to PATH unless the paths are new (i.e. don't recheck what's already there). Modified certain sets to store const wchar_t instead of wcstring to save a few allocations. https://github.com/fish-shell/fish-shell/issues/527
* First round of fixes based on cppcheckGravatar ridiculousfish2013-02-16
| | | | https://github.com/fish-shell/fish-shell/issues/575
* Make subcommands modify $status, and make builtin_set not modify status ↵Gravatar ridiculousfish2013-01-31
| | | | | | | unless it fails https://github.com/fish-shell/fish-shell/issues/547 https://github.com/fish-shell/fish-shell/issues/214
* Initial set of changes working to make fish robust against running out of ↵Gravatar ridiculousfish2013-01-30
| | | | file descriptors
* Fix for builtin_test crashGravatar ridiculousfish2013-01-06
| | | | https://github.com/fish-shell/fish-shell/issues/497
* Fix indentation of switch statementsGravatar ridiculousfish2012-11-19
|
* Apply new indentation, brace, and whitespace styleGravatar ridiculousfish2012-11-18
|
* Remove trailing whitespaces and change tabs to spacesGravatar Łukasz Niemier2012-11-18
|
* Clean up some warnings and some unused if-related codeGravatar ridiculousfish2012-09-01
|
* Adopt posix_spawn (!)Gravatar ridiculousfish2012-08-15
| | | | | Rewrite IO chains to be a vector of pointers, instead of a linked list Removed io_transmogrify
* Warning cleanupGravatar ridiculousfish2012-08-04
|
* Merge branch 'index_range'Gravatar ridiculousfish2012-07-19
|\
* | Fix for https://github.com/fish-shell/fish-shell/issues/199Gravatar ridiculousfish2012-07-07
| | | | | | | | Don't hard-fail on setting the PATH or CDPATH just because it contains an invalid entry
| * restore tabs instead of spacesGravatar maxfl2012-07-08
| |
| * Add index rangesGravatar maxfl2012-07-07
|/ | | | | | | | | | | | | | | Builtin 'set' now can set variable index ranges: set test[1..3] a b c #works set test[-1..-3] a b c #works if variable have enough elements set test[2..-2] a b c #works set test[1..3 -1..-2] a b c b b #works Expand now can parse index ranges. But not handle for now. TODO: * Add variable substitution index ranges: echo $PATH[-1..1] * Add command substitution index range: echo (seq 10)[-1..-4] * Add process substitution indexes and ranges: echo %vim[-1]
* Squashed commit of the following:Gravatar ridiculousfish2012-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 5b7659ec3d5e67b8dad8d3543d87a0169dc9a9e9 Merge: 57f3df3 22a4cd6 Author: ridiculousfish <corydoras@ridiculousfish.com> Date: Thu Jun 21 10:15:41 2012 -0700 Merge branch 'master' of https://github.com/maxfl/fish-shell into maxfl-master-base commit 22a4cd686fbe4a6730859aa1a84b21bc9c832203 Author: maxfl <gmaxfl@gmail.com> Date: Tue Jun 19 15:51:43 2012 +0400 set now expands the variable size, if index is outside it commit 9b0ffa83157ce0cfa36d246fa2e3179d6b790dea Author: maxfl <gmaxfl@gmail.com> Date: Mon Jun 18 21:30:44 2012 +0400 fixes #78 commit 78387fb3915b01342a981059780a164eedc0f8eb Merge: c0e6096 93dc7d4 Author: maxfl <gmaxfl@gmail.com> Date: Mon Jun 18 21:27:47 2012 +0400 Merge remote-tracking branch 'fishfish/master' commit c0e60963c179f80cb1d5d6a18b44510e55c95e10 Merge: 32a98e7 1bead8a Author: maxfl <gmaxfl@gmail.com> Date: Mon Jun 18 10:29:42 2012 +0400 Merge remote-tracking branch 'fishfish/master' commit 32a98e799eb2f016f8bad5287851f6353b835014 Merge: 6e71021 f2b5292 Author: maxfl <gmaxfl@gmail.com> Date: Sat Jun 16 18:42:07 2012 +0400 Merge remote-tracking branch 'fishfish/master' commit 6e710211bca0bca73d738d71e22d20e700db2a63 Author: maxfl <gmaxfl@gmail.com> Date: Thu Jun 14 11:01:13 2012 +0400 revert fish_pager commit 731a29f35bdbaa4dfaad78c7428ab2e5edb45a6c Author: maxfl <gmaxfl@gmail.com> Date: Thu Jun 14 10:57:41 2012 +0400 revert fish_pager.cpp commit 72c1bfc7bfa77bb723d6df3f030a1918db2aca8a Merge: ea74ffa 9b781c4 Author: maxfl <gmaxfl@gmail.com> Date: Wed Jun 13 17:54:11 2012 +0400 Merge branch 'master' into maxfl_completions commit ea74ffa08689a35fd08bc3520a0d52cf30365568 Author: maxfl <gmaxfl@gmail.com> Date: Wed Jun 13 17:35:20 2012 +0400 __fish_complete_command now can understand '--arg=option' tokens latexmk completion is updated commit 45b667826f3f181972e4987a3609d4ccac16a675 Author: maxfl <gmaxfl@gmail.com> Date: Wed Jun 13 16:46:47 2012 +0400 . completion commit 1c9f8ffc9e7ea45eee8aedba5a48e21c75a08882 Author: maxfl <gmaxfl@gmail.com> Date: Wed Jun 13 16:46:13 2012 +0400 a lot of new completions commit 8224d9f984a678fd49cdf78f76770977e0ae257b Author: Maxim Gonchar <gonchar@myhost.localdomain> Date: Tue Jun 12 20:19:31 2012 +0400 A lot of new completions. Some small updates and fixes of old functions and completions. commit 234ed8f5dab209fd657ccaf0dd23d636d2a06355 Author: Maxim Gonchar <gonchar@myhost.localdomain> Date: Tue Jun 12 20:03:44 2012 +0400 step-coloring initial set_color correction
* Add support for querying variables with scope options as requested in issue #132Gravatar Siteshwar Vashisht2012-06-18
|
* Fix for a busted format stringGravatar ridiculousfish2012-06-17
|
* Fix for longstanding bug where set -e would fail to erase elements from an ↵Gravatar ridiculousfish2012-05-10
| | | | | | array. This was introduced in 7b3377e78c16b3ba74edb141ca0dd2ec895806b9
* Fix to better support CDPATHGravatar ridiculousfish2012-05-06
|
* Re-implement $history variableGravatar ridiculousfish2012-03-19
| | | | Added -L option to set to mean "don't abbreviate"
* Fix to preserve errno across certain calls to stop printing EOVERFLOW ↵Gravatar ridiculousfish2012-03-03
| | | | messages in weird places
* Put fish on a diet. Tracked down the biggest memory hogs and fixed them. ↵Gravatar ridiculousfish2012-03-03
| | | | Total allocations down by a factor of 3 or so, live allocations a few KB.
* Modified env_get_string() to accept wcstring instead of wchar_t*.Gravatar Siteshwar Vashisht2012-02-24
|
* Removed a lot of string_buffer_tGravatar ridiculousfish2012-02-22
|
* Large set of changes to migrate sb_out and sb_err to wcstringGravatar ridiculousfish2012-02-22
|
* Removed some al_list functionsGravatar ridiculousfish2012-02-10
|
* Got rid of multiple cd paths, only current directory will be searched while ↵Gravatar Siteshwar Vashisht2012-02-09
| | | | changing directories, implicit cd (entering directory just by typing it's name) is removed.
* Cleanup expand_escape_variableGravatar ridiculousfish2012-02-08
|
* CLeanup the io_stack in builtin.cpp, other changes to migrate away from al_listGravatar ridiculousfish2012-02-07
|
* Removed discriminated union from block_t type, allowing us to store ↵Gravatar ridiculousfish2012-02-07
| | | | wcstrings in it
* Minor cleanup of background_highlight_context_tGravatar ridiculousfish2012-02-03
|
* Get some basic function signatures right for new instanced parserGravatar ridiculousfish2012-01-16
|
* Lots of warnings fixes and const correctnessGravatar Peter Ammon2012-01-14
|
* Redesign new environment variables to use env_var_t instead of wcstringGravatar Peter Ammon2012-01-14
| | | | Migrate uses of empty() to missing() to distinguish between empty variable and unset variable
* Modified builtin_set.cpp to use env_get(), added functions like ↵Gravatar Siteshwar Vashisht2012-01-10
| | | | update_values2(), env_set2() etc. to support wcstring and vector instead of using array_list_t