Skip to content

Commit

Permalink
Tweak names
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Dec 12, 2024
1 parent 6aa6e12 commit 8e61c03
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/alias_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::*;

#[derive(Debug, PartialEq, Clone, ValueEnum)]
pub(crate) enum AliasStyle {
Inline,
InlineLeft,
Recipe,
Left,
Right,
Separate,
}
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl Config {
.env("JUST_ALIAS_STYLE")
.action(ArgAction::Set)
.value_parser(clap::value_parser!(AliasStyle))
.default_value("inline")
.default_value("right")
.help("Set list command alias display style")
.conflicts_with(arg::NO_ALIASES),
)
Expand Down
8 changes: 4 additions & 4 deletions src/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ impl Subcommand {
) {
let color = config.color.stdout();

let inline_aliases = config.alias_style != AliasStyle::Recipe && !aliases.is_empty();
let inline_aliases = config.alias_style != AliasStyle::Separate && !aliases.is_empty();

if inline_aliases || doc.is_some() {
print!(
Expand All @@ -464,7 +464,7 @@ impl Subcommand {
);
};

if inline_aliases && config.alias_style == AliasStyle::InlineLeft {
if inline_aliases && config.alias_style == AliasStyle::Left {
print_aliases();
}

Expand All @@ -486,7 +486,7 @@ impl Subcommand {
}
}

if inline_aliases && config.alias_style == AliasStyle::Inline {
if inline_aliases && config.alias_style == AliasStyle::Right {
print_aliases();
}

Expand Down Expand Up @@ -613,7 +613,7 @@ impl Subcommand {

if let Some(recipes) = recipe_groups.get(&group) {
for recipe in recipes {
let recipe_alias_entries = if config.alias_style == AliasStyle::Recipe {
let recipe_alias_entries = if config.alias_style == AliasStyle::Separate {
aliases.get(recipe.name())
} else {
None
Expand Down
12 changes: 6 additions & 6 deletions tests/alias_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn multiple() {
}

#[test]
fn inline() {
fn right() {
Test::new()
.justfile(
"
Expand All @@ -62,7 +62,7 @@ fn inline() {
bar:
",
)
.args(["--alias-style=inline", "--list"])
.args(["--alias-style=right", "--list"])
.stdout(
"
Available recipes:
Expand All @@ -74,7 +74,7 @@ fn inline() {
}

#[test]
fn inline_left() {
fn left() {
Test::new()
.justfile(
"
Expand All @@ -86,7 +86,7 @@ fn inline_left() {
bar:
",
)
.args(["--alias-style=inline-left", "--list"])
.args(["--alias-style=left", "--list"])
.stdout(
"
Available recipes:
Expand All @@ -98,7 +98,7 @@ fn inline_left() {
}

#[test]
fn recipe() {
fn separate() {
Test::new()
.justfile(
"
Expand All @@ -110,7 +110,7 @@ fn recipe() {
bar:
",
)
.args(["--alias-style=recipe", "--list"])
.args(["--alias-style=separate", "--list"])
.stdout(
"
Available recipes:
Expand Down

0 comments on commit 8e61c03

Please sign in to comment.