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

refactor: reorganize global flags #3389

Merged
merged 7 commits into from Nov 26, 2019
Merged

refactor: reorganize global flags #3389

merged 7 commits into from Nov 26, 2019

Conversation

ry
Copy link
Member

@ry ry commented Nov 20, 2019

  • Remove ability to specify run arguments like --allow-net after the script argument. It's too hacky to make work with clap.
  • Prevent clap from auto-detecting terminal width and attempting to wrap text.
  • Remove --v8-options, instead use --v8-flags=--help
  • Give more descriptive names to unit tests in flags.rs
  • Assume argv and subcommand into DenoFlags struct so the output of flags module is only DenoFlags rather than the tuple (subcommand, flags, argv).
  • Improve CLI help text
  • Make deno run specific args like --allow-net only show up in 'deno
    help run' instead of as global flags in deno help.
  • Removes deno version to simplify our implementation and be closer to clap defaults. deno -V now only shows Deno's version and not V8's nor TypeScript. Deno.versions can be used to see that information.

- Remove ability to specify run arguments like `--allow-net` after the
  script argument. It's too hacky to make work with clap.
- Remove `--v8-options`, instead use `--v8-flags=--help`
- Give more descriptive names to unit tests in flags.rs
- Assume argv and subcommand into DenoFlags struct so the output of
  flags module is only DenoFlags rather than the tuple (subcommand, flags,
  argv).
- Improve CLI help text
- Make `deno run` specific args like `--allow-net` only show up in 'deno
  help run' instead of as global flags in `deno help`.
- Removes `deno version` to simplify our implementation and be closer to
  clap defaults. `deno -V` now only shows Deno's version and not V8's nor
  TypeScript. `Deno.versions` can be used to see that information.
- Prevent clap from auto-detecting terminal width and attempting to wrap
  text.
Copy link
Collaborator

@nayeemrmn nayeemrmn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--config, --no-fetch, --lock and --lock-write should apply to deno fetch as well. --lock-write shouldn't apply to deno test.

@ry
Copy link
Member Author

ry commented Nov 23, 2019

@nayeemrmn Why would --config apply to fetch? deno fetch --no-fetch $URL doesn't sound right. I agree about --lock and --lock-write.

@nayeemrmn
Copy link
Collaborator

@ry

Why would --config apply to fetch?

Doesn't it affect compilation?

deno fetch --no-fetch $URL doesn't sound right.

#3383 (comment). I agree that the naming is inconsistent. That was actually what prompted #3384.

@ry
Copy link
Member Author

ry commented Nov 23, 2019

Doesn't it affect compilation?

Yes, ok. I agree and I've made the change.

Regarding deno fetch --no-fetch ... I don't understand your reasoning still.

@nayeemrmn
Copy link
Collaborator

It's hard to reason about since I'm not sure what the use case of --no-fetch is in the first place...

Say I want to disable remote module downloading but I still want to use deno fetch to compile ahead of time. If deno fetch is forced to download everything, --no-fetch for deno run becomes useless since it's all already cached. I don't see why these two features should be at odds.

@ry
Copy link
Member Author

ry commented Nov 23, 2019

@nayeemrmn Ah ok. I understand now. But maybe we should call it something else like --recompile-only ? In any case let's do that in a follow up PR since it should have tests. This one's already getting too big.

@nayeemrmn
Copy link
Collaborator

@ry None of this will matter after #3384 😅 I suggest just applying it as-is for now and certainly not introducing another flag.

cli/flags.rs Show resolved Hide resolved
cli/flags.rs Show resolved Hide resolved
cli/flags.rs Show resolved Hide resolved
cli/flags.rs Show resolved Hide resolved
@hayd
Copy link
Contributor

hayd commented Nov 24, 2019

If we were to rename fetch to compile I think the flag would make a lot more sense i.e. deno compile --no-fetch.

I know @ry you wanted deno compile to mean "compile into a single binary including deno itself" but perhaps that would be better as deno binary or something like that...

Copy link
Member

@piscisaureus piscisaureus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am down with the changes to how flags are interpreted and I see no issues with the code.
That said it's a very long patch. Are there areas in particular that you think need some extra eyeballs?
Also, has this been addressed? #3389 (comment)

Tentatively approved.

@ry
Copy link
Member Author

ry commented Nov 26, 2019

That said it's a very long patch. Are there areas in particular that you think need some extra eyeballs?

Nope - I think this is good to go

Also, has this been addressed? #3389 (comment)

Now it has.

@ry ry merged commit c016684 into denoland:master Nov 26, 2019
@ry ry deleted the flags2 branch November 26, 2019 16:06
bartlomieju pushed a commit to bartlomieju/deno that referenced this pull request Dec 28, 2019
- Remove ability to specify run arguments like `--allow-net` after the
  script argument. It's too hacky to make work with clap.
- Remove `--v8-options`, instead use `--v8-flags=--help`
- Give more descriptive names to unit tests in flags.rs
- Assume argv and subcommand into DenoFlags struct so the output of
  flags module is only DenoFlags rather than the tuple (subcommand, flags,
  argv).
- Improve CLI help text
- Make `deno run` specific args like `--allow-net` only show up in 'deno
  help run' instead of as global flags in `deno help`.
- Removes `deno version` to simplify our implementation and be closer to
  clap defaults. `deno -V` now only shows Deno's version and not V8's nor
  TypeScript. `Deno.versions` can be used to see that information.
- Prevent clap from auto-detecting terminal width and attempting to wrap
  text.
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 21, 2021
- Remove ability to specify run arguments like `--allow-net` after the
  script argument. It's too hacky to make work with clap.
- Remove `--v8-options`, instead use `--v8-flags=--help`
- Give more descriptive names to unit tests in flags.rs
- Assume argv and subcommand into DenoFlags struct so the output of
  flags module is only DenoFlags rather than the tuple (subcommand, flags,
  argv).
- Improve CLI help text
- Make `deno run` specific args like `--allow-net` only show up in 'deno
  help run' instead of as global flags in `deno help`.
- Removes `deno version` to simplify our implementation and be closer to
  clap defaults. `deno -V` now only shows Deno's version and not V8's nor
  TypeScript. `Deno.versions` can be used to see that information.
- Prevent clap from auto-detecting terminal width and attempting to wrap
  text.
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
- Remove ability to specify run arguments like `--allow-net` after the
  script argument. It's too hacky to make work with clap.
- Remove `--v8-options`, instead use `--v8-flags=--help`
- Give more descriptive names to unit tests in flags.rs
- Assume argv and subcommand into DenoFlags struct so the output of
  flags module is only DenoFlags rather than the tuple (subcommand, flags,
  argv).
- Improve CLI help text
- Make `deno run` specific args like `--allow-net` only show up in 'deno
  help run' instead of as global flags in `deno help`.
- Removes `deno version` to simplify our implementation and be closer to
  clap defaults. `deno -V` now only shows Deno's version and not V8's nor
  TypeScript. `Deno.versions` can be used to see that information.
- Prevent clap from auto-detecting terminal width and attempting to wrap
  text.
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
- Remove ability to specify run arguments like `--allow-net` after the
  script argument. It's too hacky to make work with clap.
- Remove `--v8-options`, instead use `--v8-flags=--help`
- Give more descriptive names to unit tests in flags.rs
- Assume argv and subcommand into DenoFlags struct so the output of
  flags module is only DenoFlags rather than the tuple (subcommand, flags,
  argv).
- Improve CLI help text
- Make `deno run` specific args like `--allow-net` only show up in 'deno
  help run' instead of as global flags in `deno help`.
- Removes `deno version` to simplify our implementation and be closer to
  clap defaults. `deno -V` now only shows Deno's version and not V8's nor
  TypeScript. `Deno.versions` can be used to see that information.
- Prevent clap from auto-detecting terminal width and attempting to wrap
  text.
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
- Remove ability to specify run arguments like `--allow-net` after the
  script argument. It's too hacky to make work with clap.
- Remove `--v8-options`, instead use `--v8-flags=--help`
- Give more descriptive names to unit tests in flags.rs
- Assume argv and subcommand into DenoFlags struct so the output of
  flags module is only DenoFlags rather than the tuple (subcommand, flags,
  argv).
- Improve CLI help text
- Make `deno run` specific args like `--allow-net` only show up in 'deno
  help run' instead of as global flags in `deno help`.
- Removes `deno version` to simplify our implementation and be closer to
  clap defaults. `deno -V` now only shows Deno's version and not V8's nor
  TypeScript. `Deno.versions` can be used to see that information.
- Prevent clap from auto-detecting terminal width and attempting to wrap
  text.
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
- Remove ability to specify run arguments like `--allow-net` after the
  script argument. It's too hacky to make work with clap.
- Remove `--v8-options`, instead use `--v8-flags=--help`
- Give more descriptive names to unit tests in flags.rs
- Assume argv and subcommand into DenoFlags struct so the output of
  flags module is only DenoFlags rather than the tuple (subcommand, flags,
  argv).
- Improve CLI help text
- Make `deno run` specific args like `--allow-net` only show up in 'deno
  help run' instead of as global flags in `deno help`.
- Removes `deno version` to simplify our implementation and be closer to
  clap defaults. `deno -V` now only shows Deno's version and not V8's nor
  TypeScript. `Deno.versions` can be used to see that information.
- Prevent clap from auto-detecting terminal width and attempting to wrap
  text.
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
- Remove ability to specify run arguments like `--allow-net` after the
  script argument. It's too hacky to make work with clap.
- Remove `--v8-options`, instead use `--v8-flags=--help`
- Give more descriptive names to unit tests in flags.rs
- Assume argv and subcommand into DenoFlags struct so the output of
  flags module is only DenoFlags rather than the tuple (subcommand, flags,
  argv).
- Improve CLI help text
- Make `deno run` specific args like `--allow-net` only show up in 'deno
  help run' instead of as global flags in `deno help`.
- Removes `deno version` to simplify our implementation and be closer to
  clap defaults. `deno -V` now only shows Deno's version and not V8's nor
  TypeScript. `Deno.versions` can be used to see that information.
- Prevent clap from auto-detecting terminal width and attempting to wrap
  text.
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
- Remove ability to specify run arguments like `--allow-net` after the
  script argument. It's too hacky to make work with clap.
- Remove `--v8-options`, instead use `--v8-flags=--help`
- Give more descriptive names to unit tests in flags.rs
- Assume argv and subcommand into DenoFlags struct so the output of
  flags module is only DenoFlags rather than the tuple (subcommand, flags,
  argv).
- Improve CLI help text
- Make `deno run` specific args like `--allow-net` only show up in 'deno
  help run' instead of as global flags in `deno help`.
- Removes `deno version` to simplify our implementation and be closer to
  clap defaults. `deno -V` now only shows Deno's version and not V8's nor
  TypeScript. `Deno.versions` can be used to see that information.
- Prevent clap from auto-detecting terminal width and attempting to wrap
  text.
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
- Remove ability to specify run arguments like `--allow-net` after the
  script argument. It's too hacky to make work with clap.
- Remove `--v8-options`, instead use `--v8-flags=--help`
- Give more descriptive names to unit tests in flags.rs
- Assume argv and subcommand into DenoFlags struct so the output of
  flags module is only DenoFlags rather than the tuple (subcommand, flags,
  argv).
- Improve CLI help text
- Make `deno run` specific args like `--allow-net` only show up in 'deno
  help run' instead of as global flags in `deno help`.
- Removes `deno version` to simplify our implementation and be closer to
  clap defaults. `deno -V` now only shows Deno's version and not V8's nor
  TypeScript. `Deno.versions` can be used to see that information.
- Prevent clap from auto-detecting terminal width and attempting to wrap
  text.
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Feb 1, 2021
- Remove ability to specify run arguments like `--allow-net` after the
  script argument. It's too hacky to make work with clap.
- Remove `--v8-options`, instead use `--v8-flags=--help`
- Give more descriptive names to unit tests in flags.rs
- Assume argv and subcommand into DenoFlags struct so the output of
  flags module is only DenoFlags rather than the tuple (subcommand, flags,
  argv).
- Improve CLI help text
- Make `deno run` specific args like `--allow-net` only show up in 'deno
  help run' instead of as global flags in `deno help`.
- Removes `deno version` to simplify our implementation and be closer to
  clap defaults. `deno -V` now only shows Deno's version and not V8's nor
  TypeScript. `Deno.versions` can be used to see that information.
- Prevent clap from auto-detecting terminal width and attempting to wrap
  text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants