Skip to content

Commit

Permalink
feat: abandon no-inherit-env meta (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden authored Apr 13, 2024
1 parent d3b3fcf commit 29cbf47
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion docs/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ Adds metadata.
| `@meta require-tools <tool>,...` | any | Require certain tools to be available on the system. |
| `@meta man-section <1-8>` | root | Override the section for the man page, defaulting to 1. |
| `@meta inherit-flag-options` | root | Subcommands will inherit the flags/options from their parent. |
| `@meta no-inherit-env` | subcmd | Subcommands will not inherit the @env from their parent. |
| `@meta combine-shorts` | root | Short flags/options can be combined, e.g. `prog -xf => prog -x -f `. |
| `@meta symbol <param>` | any | Define a symbolic parameter, e.g. `+toolchain`, `@argument-file`. |

Expand Down
8 changes: 3 additions & 5 deletions src/command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use crate::param::{
use crate::parser::{parse, parse_symbol, Event, EventData, EventScope, Position};
use crate::utils::{
AFTER_HOOK, BEFORE_HOOK, INTERNAL_SYMBOL, MAIN_NAME, META_AUTHOR, META_COMBINE_SHORTS,
META_DEFAULT_SUBCOMMAND, META_DOTENV, META_INHERIT_FLAG_OPTIONS, META_NO_INHERIT_ENV,
META_REQUIRE_TOOLS, META_SYMBOL, META_VERSION, ROOT_NAME,
META_DEFAULT_SUBCOMMAND, META_DOTENV, META_INHERIT_FLAG_OPTIONS, META_REQUIRE_TOOLS,
META_SYMBOL, META_VERSION, ROOT_NAME,
};
use crate::Result;

Expand Down Expand Up @@ -60,9 +60,7 @@ impl Command {
if root.has_metadata(META_INHERIT_FLAG_OPTIONS) {
root.inherit_flag_options();
}
if !root.has_metadata(META_NO_INHERIT_ENV) {
root.inherit_envs();
}
root.inherit_envs();
Ok(root)
}

Expand Down
1 change: 0 additions & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pub(crate) const META_AUTHOR: &str = "author";
pub(crate) const META_DOTENV: &str = "dotenv";
pub(crate) const META_DEFAULT_SUBCOMMAND: &str = "default-subcommand";
pub(crate) const META_INHERIT_FLAG_OPTIONS: &str = "inherit-flag-options";
pub(crate) const META_NO_INHERIT_ENV: &str = "no-inherit-env";
pub(crate) const META_SYMBOL: &str = "symbol";
pub(crate) const META_COMBINE_SHORTS: &str = "combine-shorts";
pub(crate) const META_MAN_SECTION: &str = "man-section";
Expand Down

0 comments on commit 29cbf47

Please sign in to comment.