Skip to content

Commit

Permalink
env: order flags in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 24, 2024
1 parent 278878e commit 1018b56
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .idea/mise.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion completions/_mise
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ __mise_doctor_cmd() {
(( $+functions[__mise_env_cmd] )) ||
__mise_env_cmd() {
_arguments -s -S \
'(-s --shell)'{-s,--shell}'=[Shell type to generate environment variables for]:shell:(bash fish nu xonsh zsh)' \
'*::tool:__mise_tool_versions' \
'(-J --json)'{-J,--json}'[Output in JSON format]' \
'(-s --shell)'{-s,--shell}'=[Shell type to generate environment variables for]:shell:(bash fish nu xonsh zsh)' \
'(-C --cd)'{-C,--cd}'=[Change directory before running command]:cd:_directories' \
'(-q --quiet)'{-q,--quiet}'[Suppress non-error messages]' \
'*'{-v,--verbose}'[Show extra output (use -vv for even more)]' \
Expand Down
2 changes: 1 addition & 1 deletion completions/mise.bash
Original file line number Diff line number Diff line change
Expand Up @@ -1706,7 +1706,7 @@ _mise() {
return 0
;;
mise__env)
opts="-s -J -C -q -v -y -h --shell --json --cd --debug --log-level --quiet --trace --verbose --yes --help [TOOL@VERSION]..."
opts="-J -s -C -q -v -y -h --json --shell --cd --debug --log-level --quiet --trace --verbose --yes --help [TOOL@VERSION]..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
Expand Down
6 changes: 3 additions & 3 deletions docs/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ Arguments:
Tool(s) to use
Options:
-J, --json
Output in JSON format
-s, --shell <SHELL>
Shell type to generate environment variables for
[possible values: bash, fish, nu, xonsh, zsh]
-J, --json
Output in JSON format
Examples:
$ eval "$(mise env -s bash)"
$ eval "$(mise env -s zsh)"
Expand Down
8 changes: 4 additions & 4 deletions src/cli/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ use crate::toolset::{InstallOptions, Toolset, ToolsetBuilder};
#[derive(Debug, clap::Args)]
#[clap(visible_alias = "e", verbatim_doc_comment, after_long_help = AFTER_LONG_HELP)]
pub struct Env {
/// Shell type to generate environment variables for
#[clap(long, short, overrides_with = "json")]
shell: Option<ShellType>,

/// Tool(s) to use
#[clap(value_name = "TOOL@VERSION")]
tool: Vec<ToolArg>,

/// Output in JSON format
#[clap(long, short = 'J', overrides_with = "shell")]
json: bool,

/// Shell type to generate environment variables for
#[clap(long, short, overrides_with = "json")]
shell: Option<ShellType>,
}

impl Env {
Expand Down

0 comments on commit 1018b56

Please sign in to comment.