1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00
denoland-deno/cli/args
Hasan-Alrimawi e44c538f37
fix: --env flag confusing message on syntax error (#23915)
Enhanced warning message for --env flag with run and eval subcommands. 

The commit is specifically made to address issue #23674 by improving the
warning messages that appear when using the --env flag with run or eval
subcommands in the following scenarios:

1. Missing environment file.
2. Incorrect syntax in the environment file content.


**Changes made**

- Distinguishes between cases of missing environment file and wrong
syntax in the environment file content.
- Shows a concise warning message to convey the case/issue occurred.

**Code changes & enhancements**
- Implemented a match statement to handle different types of errors
received while getting and parsing the file content to display a concise
warning message, rather than simple error check and then displaying the
same warning message for whatever the type of error is.
- Updated the related existing tests to reflect the new warning
messages.
- Added two test cases to cover the wrong environment file content
syntax with both run and eval subcommands.

**Impact**
The use of --env flag with both run/eval would be more user-friendly as
it gives a precise description of what is not right when using
incorrectly.

If you could give it a look, @dsherret , I appreciate your feedback on
these changes.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-27 15:06:18 +02:00
..
deno_json.rs refactor: move deno json functionality to args module (#22710) 2024-03-05 15:45:44 -05:00
flags.rs feat(cli/test): deno test --clean (#23519) 2024-05-23 03:04:12 +00:00
flags_net.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
import_map.rs fix(workspace): provide workspace members as 'imports' in import map (#23492) 2024-04-23 17:21:06 +02:00
lockfile.rs fix(cli): Support deno.lock with only package.json present + fix DENO_FUTURE install interactions with lockfile (#23918) 2024-05-23 12:31:05 -07:00
mod.rs fix: --env flag confusing message on syntax error (#23915) 2024-05-27 15:06:18 +02:00
package_json.rs feat(lockfile): track JSR and npm dependencies in config file (#22004) 2024-01-22 22:31:12 +01:00