You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when defining flags in mise (specifically within task configurations or custom scripts), the default key typically accepts a literal value.
I would like to be able to define the default state of a flag using the flag syntax itself, or provide a way to map a flag to a set of predefined "default" arguments. This allows for more expressive configurations where a simple flag can represent a more complex internal state.
Proposed Syntax
I'd like to be able to define defaults like this:
Context / Use Case
In many CLI tools, a flag isn't just a boolean true/false, but a shorthand for a specific mode of operation. By allowing the default to be defined as a string of flags (or an alias), we can:
Standardize Tooling: Map mise flags directly to the underlying tool's more verbose flags.
Simplify Task Definitions: Users won't have to manually parse strings if the default can be passed directly as a pre-configured flag state.
Examples
If I have a task called deploy:
Defining flag "--mode" = { default = "--production" }
Running mise run deploy would effectively execute the command with the --production context.
Running mise run deploy --mode --staging would override that default.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, when defining flags in mise (specifically within task configurations or custom scripts), the default key typically accepts a literal value.
I would like to be able to define the default state of a flag using the flag syntax itself, or provide a way to map a flag to a set of predefined "default" arguments. This allows for more expressive configurations where a simple flag can represent a more complex internal state.
Proposed Syntax
I'd like to be able to define defaults like this:
Context / Use Case
In many CLI tools, a flag isn't just a boolean true/false, but a shorthand for a specific mode of operation. By allowing the default to be defined as a string of flags (or an alias), we can:
Standardize Tooling: Map mise flags directly to the underlying tool's more verbose flags.
Simplify Task Definitions: Users won't have to manually parse strings if the default can be passed directly as a pre-configured flag state.
Examples
If I have a task called deploy:
Defining
flag "--mode" = { default = "--production" }Running
mise run deploywould effectively execute the command with the--productioncontext.Running
mise run deploy --mode --stagingwould override that default.Beta Was this translation helpful? Give feedback.
All reactions