Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fish 3.0 set --help is out of date. #5493

Open
simotek opened this issue Jan 8, 2019 · 3 comments
Open

Fish 3.0 set --help is out of date. #5493

simotek opened this issue Jan 8, 2019 · 3 comments
Labels
bug Something that's not working as intended docs An issue/PR that touches or should touch the docs

Comments

@simotek
Copy link

simotek commented Jan 8, 2019

I used to use "set -ex" in a script which is no longer supported in fish 3.0 it seems. Yet set --help still shows.

   Synopsis
       set [SCOPE_OPTIONS]
       set [OPTIONS] VARIABLE_NAME VALUES...
       set [OPTIONS] VARIABLE_NAME[INDICES]... VALUES...
       set ( -q | --query ) [SCOPE_OPTIONS] VARIABLE_NAMES...
       set ( -e | --erase ) [SCOPE_OPTIONS] VARIABLE_NAME
       set ( -e | --erase ) [SCOPE_OPTIONS] VARIABLE_NAME[INDICES]...
       set ( -S | --show ) [SCOPE_OPTIONS] [VARIABLE_NAME]...

I am guessing erase should no longer have [SCOPE_OPTIONS], either that or the set command is broken.

@floam
Copy link
Member

floam commented Jan 8, 2019

set -ex should be valid, unless I've had a stroke.

@floam
Copy link
Member

floam commented Jan 8, 2019

But we do this intentionally:

    // Trying to erase and (un)export at the same time doesn't make sense.
    if (opts.erase && (opts.exportv || opts.unexport)) {
        streams.err.append_format(BUILTIN_ERR_COMBO, cmd);
        builtin_print_help(parser, streams, cmd, streams.err);
        return STATUS_INVALID_ARGS;
    }

@faho
Copy link
Member

faho commented Jan 8, 2019

I am guessing erase should no longer have [SCOPE_OPTIONS]

It should. set -el and set -eg are quite useful.

set -ex and set -eu were disallowed in 17cf255, because of #4263.

Note that "-x" isn't a scope! It's a modifier to a variable. You can have universal-exported, global-exported or local-exported variables. But for each name, you can only ever have one export-state:

set -gx banana foo
set -lu banana bar
env # won't show banana at all
set -e banana

Because of that, most of the time when people use just "-x" without a scope, they should actually be adding one.

It's possible that changes to this are sensible, I'm not sure. But with the current system, set -ex indeed makes no sense.

So we should either change exporting (which is one of those annoyingly backwards-incompatible things), or fix the documentation.

@zanchey zanchey added bug Something that's not working as intended docs An issue/PR that touches or should touch the docs labels Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that's not working as intended docs An issue/PR that touches or should touch the docs
Projects
None yet
Development

No branches or pull requests

4 participants