On 2016-03-16 12:50, Glenn Jackman wrote: > Pass it as an argument: > > function foo -a PASSWORD_STORE_DIR > echo "PSD: " $PASSWORD_STORE_DIR > end > > function passc --wraps pass > set -l PASSWORD_STORE_DIR ~/.password-store-other/ # no -x > echo "PSDL: " $PASSWORD_STORE_DIR > foo $PASSWORD_STORE_DIR > end
Thanks Glenn for the workaround, but in my case I don't control that function. When command completion for `pass` tool is used in fish the `__fish_pass_get_prefix` function is used which tries to read `PASSWORD_STORE_DIR` variable to determine where keys are stored. Thanks to `--wraps` a completion works in general, but all directory related commands points to the original directory instead of that defined in my alias. Can it be handled in fish (somehow easier than making a copy of the whole completion and hardcore a directory for my alias)? Marcin > > On Wed, Mar 16, 2016 at 7:31 AM, Marcin Zajączkowski <msz...@wp.pl> wrote: > >> Hi, >> >> I have a function which sets a variable and call another function: >> >> function foo >> echo "PSD: " $PASSWORD_STORE_DIR >> end >> >> function passc --wraps pass >> set -lx PASSWORD_STORE_DIR ~/.password-store-other/ >> echo "PSDL: " $PASSWORD_STORE_DIR >> foo >> end >> >> When `passc` is called the value is not visible in `foo` (I thought that >> -x should do it). I works with -g, but I don't want to make it global. >> How can I achieve it? >> >> Marcin >> >> >> ------------------------------------------------------------------------------ >> Transform Data into Opportunity. >> Accelerate data analysis in your applications with >> Intel Data Analytics Acceleration Library. >> Click to learn more. >> http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140 >> _______________________________________________ >> Fish-users mailing list >> Fish-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/fish-users >> > > > -- http://blog.solidsoft.info/ - Working code is not enough ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140 _______________________________________________ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users